[−][src]Enum unsegen::base::style::BoolModifyMode
Specifies how to modify a bool value.
(In essence, specifies one of all possible unary boolean functions.)
Variants
Implementations
impl BoolModifyMode
[src]
pub fn on_top_of(self, other: Self) -> Self
[src]
Combine the current value with that of the argument so that the application of the returned value is always equivalent to first applying other and then applying self to a bool.
Examples:
use unsegen::base::BoolModifyMode; assert_eq!(BoolModifyMode::LeaveUnchanged.on_top_of(BoolModifyMode::False), BoolModifyMode::False); assert_eq!(BoolModifyMode::True.on_top_of(BoolModifyMode::Toggle /*or any other value*/), BoolModifyMode::True); assert_eq!(BoolModifyMode::Toggle.on_top_of(BoolModifyMode::Toggle), BoolModifyMode::LeaveUnchanged);
pub fn modify(self, target: &mut bool)
[src]
Modify the target bool according to the modification mode.
Examples:
use unsegen::base::BoolModifyMode; let mut b = true; BoolModifyMode::False.modify(&mut b); assert_eq!(b, false); let mut b = false; BoolModifyMode::LeaveUnchanged.modify(&mut b); assert_eq!(b, false); let mut b = false; BoolModifyMode::Toggle.modify(&mut b); assert_eq!(b, true);
Trait Implementations
impl Clone for BoolModifyMode
[src]
fn clone(&self) -> BoolModifyMode
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for BoolModifyMode
[src]
impl Debug for BoolModifyMode
[src]
impl Eq for BoolModifyMode
[src]
impl From<bool> for BoolModifyMode
[src]
impl PartialEq<BoolModifyMode> for BoolModifyMode
[src]
fn eq(&self, other: &BoolModifyMode) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for BoolModifyMode
[src]
impl StructuralPartialEq for BoolModifyMode
[src]
Auto Trait Implementations
impl RefUnwindSafe for BoolModifyMode
impl Send for BoolModifyMode
impl Sync for BoolModifyMode
impl Unpin for BoolModifyMode
impl UnwindSafe for BoolModifyMode
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,