Skip to main content

ConstantBool

Struct ConstantBool 

Source
pub struct ConstantBool<T: NumOps + Copy>(pub T);

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> ConstantBool<T>
where Wrapping<T>: Neg<Output = Wrapping<T>> + BitOr<Output = Wrapping<T>>, T: NumOps + Copy + BitAnd<Output = T> + BitXor<Output = T> + BitOr<Output = T> + Shr<usize, Output = T> + One + Zero + PartialEq,

Source

pub fn mux(self, x: T, y: T) -> T

This chooses the first value if self is 1 (true), chooses the 2nd value if the value is 0 (false).

Source

pub fn is_zero(i: T) -> Self

Source

pub fn not_zero(i: T) -> Self

Source

pub fn new_true() -> Self

Source

pub fn new_false() -> Self

Trait Implementations§

Source§

impl<T: NumOps + Copy + BitAnd<Output = T>> BitAnd for ConstantBool<T>

Source§

type Output = ConstantBool<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl<T: NumOps + Copy + BitOr<Output = T>> BitOr for ConstantBool<T>

Source§

type Output = ConstantBool<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl<T: NumOps + Copy + BitOr<Output = T>> BitOrAssign for ConstantBool<T>

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<T: NumOps + Copy + BitXor<Output = T>> BitXor for ConstantBool<T>

Source§

type Output = ConstantBool<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
Source§

impl<T: Clone + NumOps + Copy> Clone for ConstantBool<T>

Source§

fn clone(&self) -> ConstantBool<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: NumOps + Copy + Zero> Default for ConstantBool<T>

Source§

fn default() -> ConstantBool<T>

Returns the “default value” for a type. Read more
Source§

impl From<bool> for ConstantBool<u32>

Source§

fn from(b: bool) -> ConstantBool<u32>

Converts to this type from the input type.
Source§

impl From<bool> for ConstantBool<u64>

Source§

fn from(b: bool) -> ConstantBool<u64>

Converts to this type from the input type.
Source§

impl<T: NumOps + Copy + BitXor<Output = T> + One> Not for ConstantBool<T>

Source§

fn not(self) -> ConstantBool<T>

Performs the unary ! operation.

Source§

type Output = ConstantBool<T>

The resulting type after applying the ! operator.
Source§

impl<T: Copy + NumOps + Copy> Copy for ConstantBool<T>

Auto Trait Implementations§

§

impl<T> Freeze for ConstantBool<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ConstantBool<T>
where T: RefUnwindSafe,

§

impl<T> Send for ConstantBool<T>
where T: Send,

§

impl<T> Sync for ConstantBool<T>
where T: Sync,

§

impl<T> Unpin for ConstantBool<T>
where T: Unpin,

§

impl<T> UnwindSafe for ConstantBool<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.