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.
Required Associated Types§
Required Methods§
sourcefn acquire<'call>(&self, data: Self::Data) -> Ref<'call, Self::Target>
fn acquire<'call>(&self, data: Self::Data) -> Ref<'call, Self::Target>
Assume ownership of data
, and returning a Target
.
sourcefn encode(&self, target: Ref<'_, Self::Target>) -> u64
fn encode(&self, target: Ref<'_, Self::Target>) -> u64
Encode target
as a u64
. The only requirement on this value is that
it be decodable by decode
.