pub struct Hooks { /* private fields */ }
Expand description
This is a collection of hooks to component manager events.
Implementations§
source§impl Hooks
impl Hooks
pub fn new() -> Self
sourcepub async fn install(&self, hooks: Vec<HooksRegistration>)
pub async fn install(&self, hooks: Vec<HooksRegistration>)
For every hook in hooks
, add it to the list of hooks that are executed when dispatch
is called for hook.event
.
sourcepub async fn install_front_for_test(&self, hooks: Vec<HooksRegistration>)
pub async fn install_front_for_test(&self, hooks: Vec<HooksRegistration>)
Same as install
, but adds the hook to the front of the queue.
This is test-only because in general it shouldn’t matter what order hooks are executed in. This is useful for tests that need guarantees about hook execution order.
pub async fn dispatch(&self, event: &Event)
Auto Trait Implementations§
impl !Freeze for Hooks
impl !RefUnwindSafe for Hooks
impl Send for Hooks
impl Sync for Hooks
impl Unpin for Hooks
impl !UnwindSafe for Hooks
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more