[][src]Trait bee_ternary::trit::Trit

pub trait Trit: Copy + Sized + Debug + Hash + Into<i8> + Ord + PartialEq + ShiftTernary + TryFrom<i8> + Display {
    fn checked_increment(self) -> Option<Self>;
fn zero() -> Self;
fn as_arbitrary_ref<'a>(&self) -> &'a Self;
fn add_to_num<I: Num + CheckedAdd + CheckedSub>(
        &self,
        n: I
    ) -> Result<I, Error>; }

A trait implemented by both balanced (Btrit) and unbalanced (Utrit) trits.

Required methods

fn checked_increment(self) -> Option<Self>

Attempt to increment the value of this trit, returning None if an overflow occurred.

fn zero() -> Self

The zero value of this trit.

fn as_arbitrary_ref<'a>(&self) -> &'a Self

Turn this trit reference into one with an arbitrary lifetime.

Note that this is largely an implementation detail and is rarely useful for API users.

fn add_to_num<I: Num + CheckedAdd + CheckedSub>(&self, n: I) -> Result<I, Error>

Attempt to add this trit to a numeric value.

Loading content...

Implementors

impl Trit for Btrit[src]

impl Trit for Utrit[src]

Loading content...