Trait hir_def::AsMacroCall

source ·
pub trait AsMacroCall {
    // Required method
    fn as_call_id_with_errors(
        &self,
        db: &dyn ExpandDatabase,
        krate: CrateId,
        resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy,
    ) -> Result<ExpandResult<Option<MacroCallId>>, UnresolvedMacro>;

    // Provided method
    fn as_call_id(
        &self,
        db: &dyn ExpandDatabase,
        krate: CrateId,
        resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy,
    ) -> Option<MacroCallId> { ... }
}
Expand description

A helper trait for converting to MacroCallId

Required Methods§

source

fn as_call_id_with_errors( &self, db: &dyn ExpandDatabase, krate: CrateId, resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy, ) -> Result<ExpandResult<Option<MacroCallId>>, UnresolvedMacro>

Provided Methods§

source

fn as_call_id( &self, db: &dyn ExpandDatabase, krate: CrateId, resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy, ) -> Option<MacroCallId>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsMacroCall for InFile<&MacroCall>

source§

fn as_call_id_with_errors( &self, db: &dyn ExpandDatabase, krate: CrateId, resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy, ) -> Result<ExpandResult<Option<MacroCallId>>, UnresolvedMacro>

Implementors§