Skip to main content

OnComponentInitializedHook

Trait OnComponentInitializedHook 

Source
pub trait OnComponentInitializedHook<Node>: Send {
    // Required method
    fn on_event(self: Box<Self>, node: Node) -> Result<()>;
}
Expand description

A helper trait for the event hook that is run once the node is initialized.

Required Methods§

Source

fn on_event(self: Box<Self>, node: Node) -> Result<()>

Consumes the event hook and runs it.

If this returns an error, the node launch will be aborted.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Node> OnComponentInitializedHook<Node> for ()

Source§

fn on_event(self: Box<Self>, _node: Node) -> Result<()>

Implementors§

Source§

impl<Node, F> OnComponentInitializedHook<Node> for F
where F: FnOnce(Node) -> Result<()> + Send,