pub trait IdentityHandler<I>: Debug {
    type Input: Clone + Debug;

    // Required methods
    fn process(&self, id: Self::Input, backend: Backend) -> I;
    fn free(&self, id: I);
}
Expand description

A type that can build true ids from proto-ids, and free true ids.

For some implementations, the true id is based on the proto-id. The caller is responsible for providing well-allocated proto-ids.

For other implementations, the proto-id carries no information (it’s (), say), and this IdentityHandler type takes care of allocating a fresh true id.

See the module-level documentation for details.

Required Associated Types§

source

type Input: Clone + Debug

The type of proto-id consumed by this filter, to produce a true id.

Required Methods§

source

fn process(&self, id: Self::Input, backend: Backend) -> I

Given a proto-id value id, return a true id for backend.

source

fn free(&self, id: I)

Free the true id id.

Implementations on Foreign Types§

source§

impl<I: TypedId + Debug> IdentityHandler<I> for Mutex<IdentityManager>

§

type Input = ()

source§

fn process(&self, _id: Self::Input, backend: Backend) -> I

source§

fn free(&self, id: I)

Implementors§