pub struct ClosureOffdeviceHook<F>(pub F)
where
F: Fn(&OffdeviceCallDescriptor) -> OffdeviceDecision + Send + Sync + 'static;Expand description
Convenience wrapper for callers that want to plug a closure in without declaring a struct. Useful for tests and for the daemon’s adapter that wraps the rule matcher.
Tuple Fields§
§0: FTrait Implementations§
Source§impl<F> OffdeviceCallHook for ClosureOffdeviceHook<F>
impl<F> OffdeviceCallHook for ClosureOffdeviceHook<F>
Source§fn before_call<'life0, 'life1, 'async_trait>(
&'life0 self,
descriptor: &'life1 OffdeviceCallDescriptor,
) -> Pin<Box<dyn Future<Output = OffdeviceDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_call<'life0, 'life1, 'async_trait>(
&'life0 self,
descriptor: &'life1 OffdeviceCallDescriptor,
) -> Pin<Box<dyn Future<Output = OffdeviceDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Decide what to do with the call. Default impl returns
Allow,
which makes wiring a hook optional — most consumers can ignore
this trait entirely.Auto Trait Implementations§
impl<F> Freeze for ClosureOffdeviceHook<F>where
F: Freeze,
impl<F> RefUnwindSafe for ClosureOffdeviceHook<F>where
F: RefUnwindSafe,
impl<F> Send for ClosureOffdeviceHook<F>
impl<F> Sync for ClosureOffdeviceHook<F>
impl<F> Unpin for ClosureOffdeviceHook<F>where
F: Unpin,
impl<F> UnsafeUnpin for ClosureOffdeviceHook<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for ClosureOffdeviceHook<F>where
F: UnwindSafe,
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