pub struct DeclUse<Sym> {
pub declared_symbols: Vec<Sym>,
pub used_symbols: Vec<Sym>,
}Expand description
Collection of defined and used symbols in a file or segment of code.
Fields§
§declared_symbols: Vec<Sym>Declared in the code. They can be imported from elsewhere, predeclared in a header file etc. or defined locally.
used_symbols: Vec<Sym>Appearing in a right-hand-side or evaluation context, such as member access, function call etc.
Implementations§
Source§impl DeclUse<SimpleName>
impl DeclUse<SimpleName>
Sourcepub fn within_extent(&self, extent: &Extent) -> Self
pub fn within_extent(&self, extent: &Extent) -> Self
Narrow down the names to a specific extent by filtering out those declarations and usages which do not overlap with the provided extent.
pub fn filter_matches(&self, names: &HashSet<&str>) -> Self
Source§impl DeclUse<FullyQualifiedName>
impl DeclUse<FullyQualifiedName>
Sourcepub fn within_extent(&self, extent: &Extent) -> Self
pub fn within_extent(&self, extent: &Extent) -> Self
Narrow down the names to a specific extent by filtering out those declarations and usages which do not overlap with the provided extent.
pub fn filter_matches(&self, names: &HashSet<&str>) -> Self
Trait Implementations§
impl<Sym: Eq> Eq for DeclUse<Sym>
impl<Sym> StructuralPartialEq for DeclUse<Sym>
Auto Trait Implementations§
impl<Sym> Freeze for DeclUse<Sym>
impl<Sym> RefUnwindSafe for DeclUse<Sym>where
Sym: RefUnwindSafe,
impl<Sym> Send for DeclUse<Sym>where
Sym: Send,
impl<Sym> Sync for DeclUse<Sym>where
Sym: Sync,
impl<Sym> Unpin for DeclUse<Sym>where
Sym: Unpin,
impl<Sym> UnwindSafe for DeclUse<Sym>where
Sym: UnwindSafe,
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> 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