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 fn install(&self, hooks: Vec<HooksRegistration>)
pub 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 fn install_front_for_test(&self, hooks: Vec<HooksRegistration>)
pub 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 UnsafeUnpin 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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more