[][src]Struct mio_signals::SignalSet

pub struct SignalSet(_);

Set of Signals used in registering signal notifications with Signals.

Examples

use mio_signals::{Signal, SignalSet};

// Signal set can be created by bit-oring (`|`) signals together.
let set: SignalSet = Signal::Interrupt | Signal::Quit;
assert_eq!(set.len(), 2);

assert!(set.contains(Signal::Interrupt));
assert!(set.contains(Signal::Quit));
assert!(!set.contains(Signal::Terminate));
assert!(set.contains(Signal::Interrupt | Signal::Quit));

Methods

impl SignalSet[src]

pub const fn all() -> SignalSet[src]

Create a new set with all signals.

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

Number of signals in the set.

pub fn contains<S>(self, other: S) -> bool where
    S: Into<SignalSet>, 
[src]

Whether or not all signals in other are contained within self.

Notes

This can also be used with Signal.

Examples

use mio_signals::{Signal, SignalSet};

let set = SignalSet::all();

assert!(set.contains(Signal::Interrupt));
assert!(set.contains(Signal::Quit));
assert!(set.contains(Signal::Interrupt | Signal::Quit));

Trait Implementations

impl BitOr<Signal> for SignalSet[src]

type Output = SignalSet

The resulting type after applying the | operator.

impl BitOr<SignalSet> for SignalSet[src]

type Output = SignalSet

The resulting type after applying the | operator.

impl BitOr<SignalSet> for Signal[src]

type Output = SignalSet

The resulting type after applying the | operator.

impl Clone for SignalSet[src]

impl Copy for SignalSet[src]

impl Debug for SignalSet[src]

impl Eq for SignalSet[src]

impl From<Signal> for SignalSet[src]

impl Hash for SignalSet[src]

impl IntoIterator for SignalSet[src]

type Item = Signal

The type of the elements being iterated over.

type IntoIter = SignalSetIter

Which kind of iterator are we turning this into?

impl Ord for SignalSet[src]

impl PartialEq<SignalSet> for SignalSet[src]

impl PartialOrd<SignalSet> for SignalSet[src]

impl StructuralEq for SignalSet[src]

impl StructuralPartialEq for SignalSet[src]

Auto Trait Implementations

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.