pub trait Context {
    type Data;
    type Target: AsFd;
    fn acquire<'call>(&self, data: Self::Data) -> Ref<'call, Self::Target>;
fn encode(&self, target: Ref<'_, Self::Target>) -> u64;
unsafe fn decode<'call>(&self, raw: u64) -> Ref<'call, Self::Target>;
fn release(&self, target: Ref<'_, Self::Target>) -> Self::Data; }
Expand description

A trait for data stored within an Epoll instance.

Associated Types

The type of an element owned by this context.

The type of a value used to refer to an element owned by this context.

Required methods

Assume ownership of data, and returning a Target.

Encode target as a u64. The only requirement on this value is that it be decodable by decode.

Decode raw, which is a value encoded by encode, into a Target.

Safety

raw must be a u64 value returned from encode, from the same context, and within the context’s lifetime.

Release ownership of the value referred to by target and return it.

Implementors