hir_def

Trait 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>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§