pub struct Usage<'db> {
pub usage: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>,
pub changes: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>,
pub snap_usage: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>,
pub introductions: OrderedHashSet<VarId<'db>>,
pub has_early_return: bool,
}Expand description
Usages of variables and member paths in semantic code.
Fields§
§usage: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>Member paths that are read.
changes: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>Member paths that are assigned to.
snap_usage: OrderedHashMap<MemberPath<'db>, ExprVarMemberPath<'db>>Member paths that are read as snapshots.
introductions: OrderedHashSet<VarId<'db>>Variables that are defined.
has_early_return: boolindicates that the expression has an early return.
Implementations§
Source§impl<'db> Usage<'db>
impl<'db> Usage<'db>
Sourcepub fn add_usage_and_changes(&mut self, usage: &Usage<'db>)
pub fn add_usage_and_changes(&mut self, usage: &Usage<'db>)
Adds the usage and changes from ‘usage’ to self, Ignoring introductions.
Sourcepub fn finalize_as_scope(&mut self)
pub fn finalize_as_scope(&mut self)
Removes usage that was introduced current block and usage that is already covered by containing variables.
Trait Implementations§
Source§impl<'db> DebugWithDb<'db> for Usage<'db>
impl<'db> DebugWithDb<'db> for Usage<'db>
type Db = ExprFormatter<'db>
fn fmt(&self, f: &mut Formatter<'_>, db: &'db ExprFormatter<'db>) -> Result
fn debug<'me>(&'me self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
fn into_debug<'me>(self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
Auto Trait Implementations§
impl<'db> Freeze for Usage<'db>
impl<'db> RefUnwindSafe for Usage<'db>
impl<'db> Send for Usage<'db>
impl<'db> Sync for Usage<'db>
impl<'db> Unpin for Usage<'db>
impl<'db> UnwindSafe for Usage<'db>
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,
Source§impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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