pub(super) struct Expander<'db> {
span_map: SpanMap<'db>,
current_file_id: HirFileId,
ast_id_map: &'db AstIdMap,
macro_depth: u32,
recursion_limit: u32,
}Fields§
§span_map: SpanMap<'db>§current_file_id: HirFileId§ast_id_map: &'db AstIdMap§macro_depth: u32recursion_depth == u32::MAX indicates that the recursion limit has been reached.
recursion_limit: u32Implementations§
Source§impl<'db> Expander<'db>
impl<'db> Expander<'db>
pub(super) fn new( db: &'db dyn SourceDatabase, current_file_id: HirFileId, def_map: &'db DefMap, ) -> Expander<'db>
pub(super) fn ctx_for_range(&self, range: TextRange) -> SyntaxContext
pub(super) fn hygiene_for_range( &self, db: &dyn SourceDatabase, range: TextRange, ) -> HygieneId
pub(super) fn is_cfg_enabled( &self, owner: &dyn HasAttrs, cfg_options: &CfgOptions, ) -> Result<(), CfgExpr>
pub(super) fn enter_expand<T: AstNode>( &mut self, db: &'db dyn SourceDatabase, macro_call: MacroCall, krate: Crate, resolver: impl Fn(&ModPath) -> Option<MacroId>, eager_callback: EagerCallBackFn<'_>, ) -> Result<ExpandResult<Option<(Mark<'db>, Option<Parse<T>>)>>, UnresolvedMacro>
pub(super) fn enter_expand_id<T: AstNode>( &mut self, db: &'db dyn SourceDatabase, call_id: MacroCallId, ) -> ExpandResult<Option<(Mark<'db>, Option<Parse<T>>)>>
pub(super) fn exit(&mut self, _: Mark<'db>)
pub(super) fn in_file<T>(&self, value: T) -> InFile<T>
pub(super) fn current_file_id(&self) -> HirFileId
fn within_limit<F, T: AstNode>( &mut self, db: &'db dyn SourceDatabase, op: F, ) -> ExpandResult<Option<(Mark<'db>, Option<Parse<T>>)>>
pub(super) fn ast_id_map(&self) -> &AstIdMap
pub(super) fn span_map(&self) -> SpanMap<'_>
Trait Implementations§
Auto Trait Implementations§
impl<'db> Freeze for Expander<'db>
impl<'db> RefUnwindSafe for Expander<'db>
impl<'db> Send for Expander<'db>
impl<'db> Sync for Expander<'db>
impl<'db> Unpin for Expander<'db>
impl<'db> UnsafeUnpin for Expander<'db>
impl<'db> UnwindSafe for Expander<'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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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