pub struct SignalSet(/* private fields */);
Expand description
Set of Signal
s 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));
Implementations§
Source§impl SignalSet
impl SignalSet
Sourcepub fn contains<S>(self, other: S) -> bool
pub fn contains<S>(self, other: S) -> bool
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§
Source§impl IntoIterator for SignalSet
impl IntoIterator for SignalSet
Source§impl Ord for SignalSet
impl Ord for SignalSet
Source§impl PartialOrd for SignalSet
impl PartialOrd for SignalSet
impl Copy for SignalSet
impl Eq for SignalSet
impl StructuralPartialEq for SignalSet
Auto Trait Implementations§
impl Freeze for SignalSet
impl RefUnwindSafe for SignalSet
impl Send for SignalSet
impl Sync for SignalSet
impl Unpin for SignalSet
impl UnwindSafe for SignalSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more