Skip to main content

ParentAware

Trait ParentAware 

Source
pub trait ParentAware {
    type Parent: HubContext;

    // Required methods
    fn inject_parent(&self, parent: Self::Parent);
    fn has_parent(&self) -> bool;
}
Expand description

Marker trait for plugins that accept parent context injection.

Plugins that implement this trait can receive context from their parent hub after construction. The associated Parent type specifies what kind of context the plugin expects.

Required Associated Types§

Source

type Parent: HubContext

The type of parent context this plugin expects.

Required Methods§

Source

fn inject_parent(&self, parent: Self::Parent)

Inject the parent context.

Called by the parent hub after plugin construction. Typically stores the context in an OnceLock for later use.

Source

fn has_parent(&self) -> bool

Check if parent has been injected.

Implementors§