[−][src]Struct popol::Sources
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]
&mut self,
events: &mut Events<K>,
timeout: Duration
) -> Result<(), Error>
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
Auto Trait Implementations
impl<K> RefUnwindSafe for Sources<K> where
K: RefUnwindSafe,
K: RefUnwindSafe,
impl<K> Send for Sources<K> where
K: Send,
K: Send,
impl<K> Sync for Sources<K> where
K: Sync,
K: Sync,
impl<K> Unpin for Sources<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for Sources<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,