Struct subtle::Choice
[−]
[src]
pub struct Choice(_);
The Choice
struct represents a choice for use in conditional
assignment.
It is a wrapper around a u8
, which should have the value either
1
(true) or 0
(false).
With the nightly
feature enabled, the conversion from u8
to
Choice
passes the value through an optimization barrier, as a
best-effort attempt to prevent the compiler from inferring that the
Choice
value is a boolean.
Methods
impl Choice
[src]
Trait Implementations
impl Copy for Choice
[src]
impl Clone for Choice
[src]
fn clone(&self) -> Choice
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl BitAnd for Choice
[src]
type Output = Choice
The resulting type after applying the &
operator.
fn bitand(self, rhs: Choice) -> Choice
[src]
Performs the &
operation.
impl BitOr for Choice
[src]
type Output = Choice
The resulting type after applying the |
operator.
fn bitor(self, rhs: Choice) -> Choice
[src]
Performs the |
operation.
impl BitXor for Choice
[src]
type Output = Choice
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Choice) -> Choice
[src]
Performs the ^
operation.
impl Not for Choice
[src]
type Output = Choice
The resulting type after applying the !
operator.
fn not(self) -> Choice
[src]
Performs the unary !
operation.