Skip to main content

Hooks

Trait Hooks 

Source
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§

Source

type Error

The exporter’s classified error.

Required Methods§

Source

fn probe<T>( &self, f: impl FnOnce() -> Result<T, Error>, ) -> Result<T, Self::Error>
where Self: Sized,

One core call, independently probed.

Source

fn env_call<T>( &self, f: impl FnOnce() -> Result<T, Error>, ) -> Result<T, Self::Error>
where Self: Sized,

One Environment call, independently probed and observed.

Source

fn row_error(&self, error: Error) -> Self::Error

A failed own row whose type is known after its successful core call.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§