Struct turbo::b3
[−]
pub struct b3(_);
A binary number ($fieldwidth digits).
Methods
impl b3
fn new(vals: [b1; 3]) -> b3
fn len(&self) -> usize
fn iter(self) -> Iter
fn bits(&self) -> [b1; 3]
Copies out the internal data as a fixed-width array.
Trait Implementations
impl Clone for b3
fn clone(&self) -> b3
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for b3
impl PartialEq for b3
fn eq(&self, __arg_0: &b3) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &b3) -> bool
This method tests for !=
.
impl Display for b3
impl<'a> Index<usize> for b3
type Output = b1
The returned type after indexing
fn index<'b>(&'b self, idx: usize) -> &'b b1
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for b3
fn index_mut<'a>(&'a mut self, index: usize) -> &'a mut b1
The method for the mutable indexing (container[index]
) operation
impl IntoIterator for b3
type Item = b1
The type of the elements being iterated over.
type IntoIter = IntoIter<b1>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a b3
type Item = &'a b1
The type of the elements being iterated over.
type IntoIter = Iter<'a, b1>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl FromIterator<b1> for b3
fn from_iter<I: IntoIterator<Item=b1>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl Add for b3
Arithmetic addition with overflow error.
type Output = Result<Self, OverflowError>
The resulting type after applying the +
operator
fn add(self, other: b3) -> Result<b3, OverflowError>
The method for the +
operator
impl<'a> Add<b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the +
operator
fn add(self, other: b3) -> Result<b3, OverflowError>
The method for the +
operator
impl<'a> Add<&'a b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the +
operator
fn add(self, other: &b3) -> Result<b3, OverflowError>
The method for the +
operator
impl Sub for b3
Arithmetic subtraction with overflow error.
type Output = Result<b3, OverflowError>
The resulting type after applying the -
operator
fn sub(self, other: b3) -> Result<b3, OverflowError>
The method for the -
operator
impl<'a> Sub<b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the -
operator
fn sub(self, other: b3) -> Result<b3, OverflowError>
The method for the -
operator
impl<'a> Sub<&'a b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the -
operator
fn sub(self, other: &b3) -> Result<b3, OverflowError>
The method for the -
operator
impl Peano for b3
This implementation is done "in reverse" of the expected logical order;
it uses the Add
and Sub
impls instead of the converse.
fn successor(&self) -> Result<b3, OverflowError>
Produces the next integer value in the field of self (i.e., increment). Read more
fn predecessor(&self) -> Result<b3, OverflowError>
Peano arithmetic function.
fn cmp(&self, other: &Self) -> Ordering
Total ordering function.
impl PartialOrd for b3
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl BitAnd for b3
type Output = Self
The resulting type after applying the &
operator
fn bitand(self, other: b3) -> Self
The method for the &
operator
impl<'a> BitAnd<b3> for &'a b3
type Output = b3
The resulting type after applying the &
operator
fn bitand(self, other: b3) -> b3
The method for the &
operator
impl<'a> BitAnd<&'a b3> for &'a b3
type Output = b3
The resulting type after applying the &
operator
fn bitand(self, other: &b3) -> b3
The method for the &
operator
impl BitOr for b3
type Output = Self
The resulting type after applying the |
operator
fn bitor(self, other: b3) -> Self
The method for the |
operator
impl<'a> BitOr<b3> for &'a b3
type Output = b3
The resulting type after applying the |
operator
fn bitor(self, other: b3) -> b3
The method for the |
operator
impl<'a> BitOr<&'a b3> for &'a b3
type Output = b3
The resulting type after applying the |
operator
fn bitor(self, other: &b3) -> b3
The method for the |
operator
impl BitXor for b3
type Output = Self
The resulting type after applying the ^
operator
fn bitxor(self, other: b3) -> Self
The method for the ^
operator
impl<'a> BitXor<b3> for &'a b3
type Output = b3
The resulting type after applying the ^
operator
fn bitxor(self, other: b3) -> b3
The method for the ^
operator
impl<'a> BitXor<&'a b3> for &'a b3
type Output = b3
The resulting type after applying the ^
operator
fn bitxor(self, other: &b3) -> b3
The method for the ^
operator
impl Shr<usize> for b3
type Output = Self
The resulting type after applying the >>
operator
fn shr(self, rhs: usize) -> Self
The method for the >>
operator
impl Shl<usize> for b3
type Output = Self
The resulting type after applying the <<
operator
fn shl(self, rhs: usize) -> Self
The method for the <<
operator
impl Mul for b3
Multiplication as repeated addition.
type Output = Result<b3, OverflowError>
The resulting type after applying the *
operator
fn mul(self, other: b3) -> Result<b3, OverflowError>
The method for the *
operator
impl<'a> Mul<b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the *
operator
fn mul(self, other: b3) -> Result<b3, OverflowError>
The method for the *
operator
impl<'a> Mul<&'a b3> for &'a b3
type Output = Result<b3, OverflowError>
The resulting type after applying the *
operator
fn mul(self, other: &b3) -> Result<b3, OverflowError>
The method for the *
operator
impl Div for b3
Implementation of division as repeated subtraction.
type Output = Result<b3, DivisionError>
The resulting type after applying the /
operator
fn div(self, other: b3) -> Result<b3, DivisionError>
The method for the /
operator
impl<'a> Div<b3> for &'a b3
type Output = Result<b3, DivisionError>
The resulting type after applying the /
operator
fn div(self, other: b3) -> Result<b3, DivisionError>
The method for the /
operator