Struct SearchScope
pub struct SearchScope { /* private fields */ }Expand description
Generally, search_scope returns files that might contain references for the element.
For pub(crate) things it’s a crate, for pub things it’s a crate and dependant crates.
In some cases, the location of the references is known to within a TextRange,
e.g. for things like local variables.
Implementations§
§impl SearchScope
impl SearchScope
pub fn module_and_children(db: &RootDatabase, module: Module) -> SearchScope
pub fn module_and_children(db: &RootDatabase, module: Module) -> SearchScope
Build a search scope spanning the given module and all its submodules.
pub fn empty() -> SearchScope
pub fn empty() -> SearchScope
Build an empty search scope.
pub fn single_file(file: EditionedFileId) -> SearchScope
pub fn single_file(file: EditionedFileId) -> SearchScope
Build a empty search scope spanning the given file.
pub fn file_range(range: FileRangeWrapper<EditionedFileId>) -> SearchScope
pub fn file_range(range: FileRangeWrapper<EditionedFileId>) -> SearchScope
Build a empty search scope spanning the text range of the given file.
pub fn files(files: &[EditionedFileId]) -> SearchScope
pub fn files(files: &[EditionedFileId]) -> SearchScope
Build a empty search scope spanning the given files.
pub fn intersection(&self, other: &SearchScope) -> SearchScope
Trait Implementations§
§impl Clone for SearchScope
impl Clone for SearchScope
§fn clone(&self) -> SearchScope
fn clone(&self) -> SearchScope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for SearchScope
impl Debug for SearchScope
§impl IntoIterator for SearchScope
impl IntoIterator for SearchScope
Auto Trait Implementations§
impl Freeze for SearchScope
impl RefUnwindSafe for SearchScope
impl Send for SearchScope
impl Sync for SearchScope
impl Unpin for SearchScope
impl UnwindSafe for SearchScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more