Trait vmm_sys_util::poll::PollToken[][src]

pub trait PollToken {
    fn as_raw_token(&self) -> u64;
fn from_raw_token(data: u64) -> Self; }
Expand description

Trait for a token that can be associated with an fd in a PollContext.

Simple enums that have no or primitive variant data can use the #[derive(PollToken)] custom derive to implement this trait.

Required methods

Converts this token into a u64 that can be turned back into a token via from_raw_token.

Converts a raw token as returned from as_raw_token back into a token.

It is invalid to give a raw token that was not returned via as_raw_token from the same Self. The implementation can expect that this will never happen as a result of its usage in PollContext.

Implementations on Foreign Types

Implementors