pub struct Local<'db> {
pub(crate) parent: ExpressionStoreOwnerId,
pub(crate) parent_infer: InferBodyId<'db>,
pub(crate) binding_id: BindingId,
}Expand description
A single local definition.
Fields§
§parent: ExpressionStoreOwnerId§parent_infer: InferBodyId<'db>§binding_id: BindingIdImplementations§
Source§impl<'db> Local<'db>
impl<'db> Local<'db>
pub fn is_param(self, db: &dyn HirDatabase) -> bool
pub fn as_self_param(self, db: &dyn HirDatabase) -> Option<SelfParam>
pub fn name(self, db: &dyn HirDatabase) -> Name
pub fn is_self(self, db: &dyn HirDatabase) -> bool
pub fn is_mut(self, db: &dyn HirDatabase) -> bool
pub fn is_ref(self, db: &dyn HirDatabase) -> bool
pub fn parent(self, _db: &dyn HirDatabase) -> ExpressionStoreOwner
pub fn module(self, db: &dyn HirDatabase) -> Module
pub fn as_id(self) -> u32
pub fn ty(self, db: &'db dyn HirDatabase) -> Type<'db>
Sourcepub fn sources(self, db: &dyn HirDatabase) -> Vec<LocalSource<'db>>
pub fn sources(self, db: &dyn HirDatabase) -> Vec<LocalSource<'db>>
All definitions for this local. Example: let (a$0, _) | (_, a$0) = it;
Sourcepub fn primary_source(self, db: &dyn HirDatabase) -> LocalSource<'db>
pub fn primary_source(self, db: &dyn HirDatabase) -> LocalSource<'db>
The leftmost definition for this local. Example: let (a$0, _) | (_, a) = it;
Trait Implementations§
Source§impl Ord for Local<'_>
impl Ord for Local<'_>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'db> PartialEq for Local<'db>
impl<'db> PartialEq for Local<'db>
Source§impl PartialOrd for Local<'_>
impl PartialOrd for Local<'_>
impl<'db> Copy for Local<'db>
impl<'db> Eq for Local<'db>
impl<'db> StructuralPartialEq for Local<'db>
Auto Trait Implementations§
impl<'db> Freeze for Local<'db>
impl<'db> RefUnwindSafe for Local<'db>
impl<'db> Send for Local<'db>
impl<'db> Sync for Local<'db>
impl<'db> Unpin for Local<'db>
impl<'db> UnsafeUnpin for Local<'db>
impl<'db> UnwindSafe for Local<'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,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> 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