Struct sparse_bin_mat::BinNum[][src]

pub struct BinNum { /* fields omitted */ }

A wrapper around an integer limited to value 0 and 1.

Implementations

impl BinNum[src]

pub fn new(number: u8) -> Self[src]

Returns a new BinNum.

Panic

Panics if the given number is not 0 or 1.

pub fn one() -> Self[src]

Returns the binary number 1.

pub fn zero() -> Self[src]

Returns the binary number 0.

pub fn is_one(self) -> bool[src]

Checks if a binary number has value 1.

pub fn is_zero(self) -> bool[src]

Checks if a binary number has value 0.

Trait Implementations

impl Add<BinNum> for BinNum[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<BinNum> for BinNum[src]

impl Clone for BinNum[src]

impl Copy for BinNum[src]

impl Debug for BinNum[src]

impl Display for BinNum[src]

impl Eq for BinNum[src]

impl From<u8> for BinNum[src]

impl Hash for BinNum[src]

impl Mul<BinNum> for BinNum[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<BinNum> for BinNum[src]

impl Ord for BinNum[src]

impl PartialEq<BinNum> for BinNum[src]

impl PartialOrd<BinNum> for BinNum[src]

impl StructuralEq for BinNum[src]

impl StructuralPartialEq for BinNum[src]

Auto Trait Implementations

impl RefUnwindSafe for BinNum

impl Send for BinNum

impl Sync for BinNum

impl Unpin for BinNum

impl UnwindSafe for BinNum

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.