pub trait OffdeviceCallHook: Send + Sync {
// Provided method
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 { ... }
}Expand description
The hook producers consult before dispatching an off-device call.
Implementations must be cheap: this fires on every cloud call made by the memory subsystem. Keep implementations proportional to the number of rules or checks they evaluate.
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".