pub struct Hooks<'a> { /* private fields */ }Expand description
Used to register test hooks for an FxFilesystem.
Implementations§
Source§impl<'a> Hooks<'a>
impl<'a> Hooks<'a>
Sourcepub fn new() -> (Self, Arc<HooksHandle>)
pub fn new() -> (Self, Arc<HooksHandle>)
Creates a new Hooks instance and an associated HooksHandle.
Sourcepub fn set_pre_commit(
&mut self,
hook: impl Fn(&Transaction<'_>) -> Result<(), Error> + Send + Sync + 'a,
)
pub fn set_pre_commit( &mut self, hook: impl Fn(&Transaction<'_>) -> Result<(), Error> + Send + Sync + 'a, )
Sets the hook executed before committing a transaction. This hook is called before
any locks required for the commit are taken, so it’s before any transaction locks
are upgraded to write locks, before any guards that are taken by calling
prepare_commit for objects involved in the transaction, and before the commit mutex
is acquired.
Sourcepub fn set_before_commit(&mut self, hook: impl Fn() + Send + Sync + 'a)
pub fn set_before_commit(&mut self, hook: impl Fn() + Send + Sync + 'a)
Sets the hook executed before a transaction starts committing. This hook is called
after calling prepare_commit on all objects involved in the transaction (which
might acquire some locks/guards), but before acquiring the commit mutex.
Sourcepub fn set_unlock_resources_acquired(
&mut self,
hook: impl Fn() + Send + Sync + 'a,
)
pub fn set_unlock_resources_acquired( &mut self, hook: impl Fn() + Send + Sync + 'a, )
Sets the hook executed when resources are acquired during unlock. This is called after acquiring all the keys that might be required from the crypt service.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Hooks<'a>
impl<'a> !Sync for Hooks<'a>
impl<'a> !UnwindSafe for Hooks<'a>
impl<'a> Freeze for Hooks<'a>
impl<'a> Send for Hooks<'a>
impl<'a> Unpin for Hooks<'a>
impl<'a> UnsafeUnpin for Hooks<'a>
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
§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<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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>
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>
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