pub struct SymField<'db>(Id, PhantomData<&'db Value<SymField<'static>>>);Expand description
Symbol for a field of a class, struct, or enum
Tuple Fields§
§0: Id§1: PhantomData<&'db Value<SymField<'static>>>Implementations§
Source§impl SymField<'static>
impl SymField<'static>
pub fn ingredient(db: &dyn Database) -> &IngredientImpl<SymField<'static>>
Source§impl<'db> SymField<'db>
impl<'db> SymField<'db>
pub fn new<Db_>(
db: &'db Db_,
scope_item: ScopeItem<'db>,
name: Identifier<'db>,
name_span: Span<'db>,
source: AstFieldDecl<'db>,
) -> Selfwhere
Db_: ?Sized + Database,
pub fn scope_item<Db_>(self, db: &'db Db_) -> ScopeItem<'db>where
Db_: ?Sized + Database,
pub fn name<Db_>(self, db: &'db Db_) -> Identifier<'db>where
Db_: ?Sized + Database,
pub fn name_span<Db_>(self, db: &'db Db_) -> Span<'db>where
Db_: ?Sized + Database,
pub fn source<Db_>(self, db: &'db Db_) -> AstFieldDecl<'db>where
Db_: ?Sized + Database,
Source§impl<'_db> SymField<'_db>
impl<'_db> SymField<'_db>
Sourcepub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Resultwhere
for<'db> ScopeItem<'db>: Debug,
for<'db> Identifier<'db>: Debug,
for<'db> Span<'db>: Debug,
for<'db> AstFieldDecl<'db>: Debug,
pub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Resultwhere
for<'db> ScopeItem<'db>: Debug,
for<'db> Identifier<'db>: Debug,
for<'db> Span<'db>: Debug,
for<'db> AstFieldDecl<'db>: Debug,
Default debug formatting for this struct (may be useful if you define your own Debug impl)
Source§impl<'db> SymField<'db>
impl<'db> SymField<'db>
Sourcepub fn self_sym(self: SymField<'db>, db: &'db dyn Db) -> SymVariable<'db>
pub fn self_sym(self: SymField<'db>, db: &'db dyn Db) -> SymVariable<'db>
The symbol for the self variable that appears in this field’s type.
(Every field and class member has their own self symbol.)
Sourcepub fn into_scope(self, db: &'db dyn Db) -> Scope<'db, 'db>
pub fn into_scope(self, db: &'db dyn Db) -> Scope<'db, 'db>
The scope for resolving the type of this field.
Trait Implementations§
Source§impl<'db> CheckedFieldTy<'db> for SymField<'db>
impl<'db> CheckedFieldTy<'db> for SymField<'db>
Source§impl Configuration for SymField<'static>
impl Configuration for SymField<'static>
Source§const DEBUG_NAME: &'static str = "SymField"
const DEBUG_NAME: &'static str = "SymField"
The debug name of the tracked struct.
Source§const FIELD_DEBUG_NAMES: &'static [&'static str]
const FIELD_DEBUG_NAMES: &'static [&'static str]
The debug names of any fields.
Source§const TRACKED_FIELD_INDICES: &'static [usize]
const TRACKED_FIELD_INDICES: &'static [usize]
The relative indices of any tracked fields.
Source§type Fields<'db> = (ScopeItem<'db>, Identifier<'db>, Span<'db>, AstFieldDecl<'db>)
type Fields<'db> = (ScopeItem<'db>, Identifier<'db>, Span<'db>, AstFieldDecl<'db>)
A (possibly empty) tuple of the fields for this struct.
Source§type Revisions = Array<Revision, 0>
type Revisions = Array<Revision, 0>
A array of [
Revision][] values, one per each of the tracked value fields.
When a struct is re-recreated in a new revision, the corresponding
entries for each field are updated to the new revision if their
values have changed (or if the field is marked as #[no_eq]).type Struct<'db> = SymField<'db>
Source§fn struct_from_id<'db>(id: Id) -> Self::Struct<'db>
fn struct_from_id<'db>(id: Id) -> Self::Struct<'db>
Create an end-user struct from the underlying raw pointer. Read more
Source§fn deref_struct(s: Self::Struct<'_>) -> Id
fn deref_struct(s: Self::Struct<'_>) -> Id
Deref the struct to yield the underlying id.
fn untracked_fields(fields: &Self::Fields<'_>) -> impl Hash
Source§fn new_revisions(current_revision: Revision_) -> Self::Revisions
fn new_revisions(current_revision: Revision_) -> Self::Revisions
Create a new value revision array where each element is set to
current_revision.Source§unsafe fn update_fields<'db>(
current_revision: Revision_,
revisions: &mut Self::Revisions,
old_fields: *mut Self::Fields<'db>,
new_fields: Self::Fields<'db>,
) -> bool
unsafe fn update_fields<'db>( current_revision: Revision_, revisions: &mut Self::Revisions, old_fields: *mut Self::Fields<'db>, new_fields: Self::Fields<'db>, ) -> bool
Update the field data and, if the value has changed,
the appropriate entry in the
revisions array (tracked fields only). Read moreSource§impl<'db> From<SymField<'db>> for SymClassMember<'db>
impl<'db> From<SymField<'db>> for SymClassMember<'db>
Source§impl<'db> Ord for SymField<'db>
impl<'db> Ord for SymField<'db>
1.21.0 · 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> PartialOrd for SymField<'db>
impl<'db> PartialOrd for SymField<'db>
Source§impl<'db> SourceSpanned<'db> for SymField<'db>
impl<'db> SourceSpanned<'db> for SymField<'db>
fn source_span(&self, db: &'db dyn Db) -> Span<'db>
Source§impl<'db> Subst<'db> for SymField<'db>
impl<'db> Subst<'db> for SymField<'db>
Source§type GenericTerm = SymGenericTerm<'db>
type GenericTerm = SymGenericTerm<'db>
The notion of generic term appropriate for this type.
When we substitute variables, this is the type of value that we replace them with.
Source§fn subst_vars(
&self,
db: &'db dyn Db,
map: &Map<SymVariable<'db>, Self::GenericTerm>,
) -> Self::Output
fn subst_vars( &self, db: &'db dyn Db, map: &Map<SymVariable<'db>, Self::GenericTerm>, ) -> Self::Output
Returns a version of
self where universal free variables
have been replaced by the corresponding entry in terms.
If a variable is not present in terms it is not substituted.Source§fn subst_var(
&self,
db: &'db dyn Db,
var: SymVariable<'db>,
term: Self::GenericTerm,
) -> Self::Output
fn subst_var( &self, db: &'db dyn Db, var: SymVariable<'db>, term: Self::GenericTerm, ) -> Self::Output
Replace the variable
var with term.Source§fn resolve_infer_var(
&self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>,
) -> Self::Output
fn resolve_infer_var( &self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>, ) -> Self::Output
Replace all inference variables with whatever is returned by
op;
if op returns None, the inference variable is left unchanged.Source§impl<'db, Term> SubstWith<'db, Term> for SymField<'db>
impl<'db, Term> SubstWith<'db, Term> for SymField<'db>
Source§fn subst_with<'subst>(
&self,
_db: &'db dyn Db,
_bound_vars: &mut Vec<SymVariable<'db>>,
_subst_fns: &mut SubstitutionFns<'_, 'db, Term>,
) -> Self::Output
fn subst_with<'subst>( &self, _db: &'db dyn Db, _bound_vars: &mut Vec<SymVariable<'db>>, _subst_fns: &mut SubstitutionFns<'_, 'db, Term>, ) -> Self::Output
Source§impl TrackedStructInDb for SymField<'_>
impl TrackedStructInDb for SymField<'_>
Source§fn database_key_index(db: &dyn Database, id: Id) -> DatabaseKeyIndex
fn database_key_index(db: &dyn Database, id: Id) -> DatabaseKeyIndex
Converts the identifier for this tracked struct into a
DatabaseKeyIndex.impl<'db> Copy for SymField<'db>
impl<'db> Eq for SymField<'db>
impl Send for SymField<'_>
impl<'db> StructuralPartialEq for SymField<'db>
impl Sync for SymField<'_>
Auto Trait Implementations§
impl<'db> Freeze for SymField<'db>
impl<'db> !RefUnwindSafe for SymField<'db>
impl<'db> Unpin for SymField<'db>
impl<'db> UnsafeUnpin for SymField<'db>
impl<'db> !UnwindSafe for SymField<'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<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
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
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<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