[][src]Struct gaea::os::signals::SignalSet

pub struct SignalSet(_);

Set of Signals used in registering signal notifications with Signals.

Examples

use gaea::os::{Signal, SignalSet};

// Signal set can be created by bit-oring (`|`) signals together.
let set: SignalSet = Signal::Interrupt | Signal::Quit;
assert_eq!(set.size(), 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 empty() -> SignalSet[src]

Create an empty signal set.

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

Create a new set with all signals.

pub const fn size(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 gaea::os::{Signal, SignalSet};

let set = SignalSet::all();

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

let empty = SignalSet::empty();
assert!(!empty.contains(Signal::Terminate));
assert!(!empty.contains(Signal::Terminate | Signal::Quit));

Trait Implementations

impl Eq for SignalSet[src]

impl Ord for SignalSet[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialEq<SignalSet> for SignalSet[src]

impl Copy for SignalSet[src]

impl Clone for SignalSet[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialOrd<SignalSet> for SignalSet[src]

impl From<Signal> 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 Debug for SignalSet[src]

impl BitOr<SignalSet> for SignalSet[src]

type Output = SignalSet

The resulting type after applying the | operator.

impl BitOr<Signal> 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 Hash for SignalSet[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for SignalSet

impl Sync for SignalSet

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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, 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.

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

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

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