pub struct SyntaxContext(/* private fields */);Expand description
A syntax context describes a hierarchy tracking order of macro definitions.
Implementations§
Source§impl SyntaxContext
impl SyntaxContext
pub fn ingredient(zalsa: &Zalsa) -> &IngredientImpl<Self>
Source§impl<'db> SyntaxContext
impl<'db> SyntaxContext
pub fn new<Db, T0: Lookup<Option<MacroCallId>> + Hash, T1: Lookup<Transparency> + Hash, T2: Lookup<Edition> + Hash, T3: Lookup<SyntaxContext> + Hash>(
db: &'db Db,
outer_expn: T0,
outer_transparency: T1,
edition: T2,
parent: T3,
opaque: impl FnOnce(SyntaxContext) -> SyntaxContext,
opaque_and_semitransparent: impl FnOnce(SyntaxContext) -> SyntaxContext,
) -> Selfwhere
Db: ?Sized + Database,
Option<MacroCallId>: HashEqLike<T0>,
Transparency: HashEqLike<T1>,
Edition: HashEqLike<T2>,
SyntaxContext: HashEqLike<T3>,
Sourcepub fn outer_expn<Db>(self, db: &'db Db) -> Option<MacroCallId>
pub fn outer_expn<Db>(self, db: &'db Db) -> Option<MacroCallId>
Invariant: Only [SyntaxContext::ROOT] has a None outer expansion.
pub fn outer_transparency<Db>(self, db: &'db Db) -> Transparency
pub fn edition<Db>(self, db: &'db Db) -> Edition
pub fn parent<Db>(self, db: &'db Db) -> SyntaxContext
Sourcepub fn opaque<Db>(self, db: &'db Db) -> SyntaxContext
pub fn opaque<Db>(self, db: &'db Db) -> SyntaxContext
This context, but with all transparent and semi-transparent expansions filtered away.
Sourcepub fn opaque_and_semitransparent<Db>(self, db: &'db Db) -> SyntaxContext
pub fn opaque_and_semitransparent<Db>(self, db: &'db Db) -> SyntaxContext
This context, but with all transparent expansions filtered away.
Source§impl SyntaxContext
impl SyntaxContext
Source§impl<'db> SyntaxContext
impl<'db> SyntaxContext
pub const fn into_u32(self) -> u32
pub fn outer_mark( self, db: &'db dyn Database, ) -> (Option<MacroCallId>, Transparency)
pub fn normalize_to_macros_2_0(self, db: &'db dyn Database) -> SyntaxContext
pub fn normalize_to_macro_rules(self, db: &'db dyn Database) -> SyntaxContext
pub fn is_opaque(self, db: &'db dyn Database) -> bool
pub fn remove_mark( &mut self, db: &'db dyn Database, ) -> (Option<MacroCallId>, Transparency)
pub fn marks( self, db: &'db dyn Database, ) -> impl Iterator<Item = (MacroCallId, Transparency)>
pub fn marks_rev( self, db: &'db dyn Database, ) -> impl Iterator<Item = (MacroCallId, Transparency)>
Trait Implementations§
Source§impl Clone for SyntaxContext
impl Clone for SyntaxContext
Source§fn clone(&self) -> SyntaxContext
fn clone(&self) -> SyntaxContext
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 moreSource§impl Configuration for SyntaxContext
impl Configuration for SyntaxContext
const LOCATION: Location
const DEBUG_NAME: &'static str = "SyntaxContextData"
const REVISIONS: NonZeroUsize = std::num::NonZeroUsize::MAX
Source§type Struct<'a> = SyntaxContext
type Struct<'a> = SyntaxContext
The end user struct
Source§fn serialize<S>(_: &Self::Fields<'_>, _: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize<S>(_: &Self::Fields<'_>, _: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize the fields using
serde. Read moreSource§fn deserialize<'de, D>(_: D) -> Result<Self::Fields<'static>, D::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(_: D) -> Result<Self::Fields<'static>, D::Error>where
D: Deserializer<'de>,
Deserialize the fields using
serde. Read moreSource§impl Debug for SyntaxContext
impl Debug for SyntaxContext
Source§impl Display for SyntaxContext
impl Display for SyntaxContext
Source§impl HasJar for SyntaxContext
impl HasJar for SyntaxContext
Source§impl Hash for SyntaxContext
impl Hash for SyntaxContext
Source§impl Ord for SyntaxContext
impl Ord for SyntaxContext
Source§fn cmp(&self, other: &SyntaxContext) -> Ordering
fn cmp(&self, other: &SyntaxContext) -> Ordering
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 PartialEq for SyntaxContext
impl PartialEq for SyntaxContext
Source§impl PartialOrd for SyntaxContext
impl PartialOrd for SyntaxContext
Source§impl SalsaStructInDb for SyntaxContext
impl SalsaStructInDb for SyntaxContext
type MemoIngredientMap = MemoIngredientSingletonIndex
Source§fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
Lookup or create ingredient indices. Read more
Source§fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
Returns the IDs of any instances of this struct in the database.
Source§impl Update for SyntaxContext
impl Update for SyntaxContext
impl Copy for SyntaxContext
impl Eq for SyntaxContext
impl Send for SyntaxContext
impl StructuralPartialEq for SyntaxContext
impl Sync for SyntaxContext
Auto Trait Implementations§
impl Freeze for SyntaxContext
impl !RefUnwindSafe for SyntaxContext
impl Unpin for SyntaxContext
impl !UnwindSafe for SyntaxContext
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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