pub trait Hooks {
type Error;
// Required methods
fn probe<T>(
&self,
f: impl FnOnce() -> Result<T, Error>,
) -> Result<T, Self::Error>
where Self: Sized;
fn env_call<T>(
&self,
f: impl FnOnce() -> Result<T, Error>,
) -> Result<T, Self::Error>
where Self: Sized;
fn row_error(&self, error: Error) -> Self::Error;
}Expand description
Per-core-call hooks. Map errors inside the caller’s refusal probe; Environment calls can additionally inspect evictions after the probe.
Required Associated Types§
Required Methods§
Sourcefn probe<T>(
&self,
f: impl FnOnce() -> Result<T, Error>,
) -> Result<T, Self::Error>where
Self: Sized,
fn probe<T>(
&self,
f: impl FnOnce() -> Result<T, Error>,
) -> Result<T, Self::Error>where
Self: Sized,
One core call, independently probed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".