Tryte

Enum Tryte 

Source
#[repr(i8)]
pub enum Tryte {
Show 27 variants N = -13, O = -12, P = -11, Q = -10, R = -9, S = -8, T = -7, U = -6, V = -5, W = -4, X = -3, Y = -2, Z = -1, Nine = 0, A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10, K = 11, L = 12, M = 13,
}
Available on crate feature ternary_encoding only.
Expand description

A ternary tryte. Equivalent to 3 trits.

Variants§

§

N = -13

§

O = -12

§

P = -11

§

Q = -10

§

R = -9

§

S = -8

§

T = -7

§

U = -6

§

V = -5

§

W = -4

§

X = -3

§

Y = -2

§

Z = -1

§

Nine = 0

§

A = 1

§

B = 2

§

C = 3

§

D = 4

§

E = 5

§

F = 6

§

G = 7

§

H = 8

§

I = 9

§

J = 10

§

K = 11

§

L = 12

§

M = 13

Implementations§

Source§

impl Tryte

Source

pub const MIN_VALUE: Self = Tryte::N

The minimum value that this Tryte can hold.

Source

pub const MAX_VALUE: Self = Tryte::M

The maximum value that this Tryte can hold.

Source

pub fn from_trits(trits: [Btrit; 3]) -> Self

Turn an array of three Btrits into a Tryte.

Source

pub fn as_trits(&self) -> &Trits<T3B1>

Interpret this tryte as a T3B1 trit slice with exactly 3 elements.

Source

pub fn as_trits_mut(&mut self) -> &mut Trits<T3B1>

Interpret this tryte as a mutable T3B1 trit slice with exactly 3 elements.

Trait Implementations§

Source§

impl Clone for Tryte

Source§

fn clone(&self) -> Tryte

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 Debug for Tryte

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Tryte

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<[Btrit; 3]> for Tryte

Source§

fn from(trits: [Btrit; 3]) -> Self

Converts to this type from the input type.
Source§

impl From<Tryte> for char

Source§

fn from(tryte: Tryte) -> char

Converts to this type from the input type.
Source§

impl FromIterator<Tryte> for TryteBuf

Source§

fn from_iter<I: IntoIterator<Item = Tryte>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl Hash for Tryte

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Tryte

Source§

fn eq(&self, other: &Tryte) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<char> for Tryte

Source§

type Error = Error

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

fn try_from(c: char) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i8> for Tryte

Source§

type Error = Error

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

fn try_from(x: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Tryte

Source§

impl Eq for Tryte

Source§

impl StructuralPartialEq for Tryte

Auto Trait Implementations§

§

impl Freeze for Tryte

§

impl RefUnwindSafe for Tryte

§

impl Send for Tryte

§

impl Sync for Tryte

§

impl Unpin for Tryte

§

impl UnwindSafe for Tryte

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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.