Skip to main content

TraitDeclarationHook

Trait TraitDeclarationHook 

Source
pub trait TraitDeclarationHook: Provider {
    // Provided methods
    fn on_enter_trait(
        &self,
        _trait_: &Trait<'_>,
        _metadata: &ClassLikeMetadata,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<()> { ... }
    fn on_leave_trait(
        &self,
        _trait_: &Trait<'_>,
        _metadata: &ClassLikeMetadata,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<()> { ... }
}
Expand description

Hook trait for intercepting trait declaration analysis.

Provided Methods§

Source

fn on_enter_trait( &self, _trait_: &Trait<'_>, _metadata: &ClassLikeMetadata, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>

Called when entering a trait declaration.

§Errors

Returns [HookError] if the underlying plugin implementation propagates one.

Source

fn on_leave_trait( &self, _trait_: &Trait<'_>, _metadata: &ClassLikeMetadata, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>

Called when leaving a trait declaration.

§Errors

Returns [HookError] if the underlying plugin implementation propagates one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§