Trait bee_ternary::trit::Trit
source · [−]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>;
}
Required methods
fn checked_increment(self) -> Option<Self>
fn checked_increment(self) -> Option<Self>
Attempt to increment the value of this trit, returning None
if an overflow occurred.
fn as_arbitrary_ref<'a>(&self) -> &'a Self
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>
fn add_to_num<I: Num + CheckedAdd + CheckedSub>(&self, n: I) -> Result<I, Error>
Attempt to add this trit to a numeric value.