[][src]Struct popol::Sources

pub struct Sources<K> { /* fields omitted */ }

Keeps track of sources to poll.

Implementations

impl<K: Eq + Clone> Sources<K>[src]

pub fn new() -> Self[src]

Creates a new set of sources to poll.

pub fn with_capacity(cap: usize) -> Self[src]

Creates a new set of sources to poll, with the given capacity. Use this if you have a lot of sources to poll.

pub fn len(&self) -> usize[src]

Return the number of registered sources.

pub fn is_empty(&self) -> bool[src]

Return whether the source registry is empty.

pub fn register(&mut self, key: K, fd: &impl AsRawFd, events: Interest)[src]

Register a new source, with the given key, and wait for the specified events.

pub fn unregister(&mut self, key: &K)[src]

Unregister a source, given its key.

pub fn set(&mut self, key: &K, events: Interest) -> bool[src]

Set the events to poll for on a source identified by its key.

pub fn unset(&mut self, key: &K, events: Interest) -> bool[src]

Unset event interests on a source.

pub fn get_mut(&mut self, key: &K) -> Option<&mut Source>[src]

Get a source by key.

pub fn wait_timeout(
    &mut self,
    events: &mut Events<K>,
    timeout: Duration
) -> Result<(), Error>
[src]

Wait for readiness events on the given list of sources. If no event is returned within the given timeout, returns an error of kind io::ErrorKind::TimedOut.

pub fn wait(&mut self, events: &mut Events<K>) -> Result<(), Error>[src]

Wait for readiness events on the given list of sources, or until the call is interrupted.

Trait Implementations

impl<K: Clone> Clone for Sources<K>[src]

impl<K: Debug> Debug for Sources<K>[src]

Auto Trait Implementations

impl<K> RefUnwindSafe for Sources<K> where
    K: RefUnwindSafe

impl<K> Send for Sources<K> where
    K: Send

impl<K> Sync for Sources<K> where
    K: Sync

impl<K> Unpin for Sources<K> where
    K: Unpin

impl<K> UnwindSafe for Sources<K> where
    K: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.