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§
Sourcetype Parent: HubContext
type Parent: HubContext
The type of parent context this plugin expects.
Required Methods§
Sourcefn inject_parent(&self, parent: Self::Parent)
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.
Sourcefn has_parent(&self) -> bool
fn has_parent(&self) -> bool
Check if parent has been injected.