Struct bee_ternary::t5b1::T5B1
source · [−]#[repr(transparent)]pub struct T5B1(_);
Expand description
An encoding scheme slice that uses a single byte to represent five trits.
Trait Implementations
sourceimpl RawEncoding for T5B1
impl RawEncoding for T5B1
sourceconst TRITS_PER_BYTE: usize = 5usize
const TRITS_PER_BYTE: usize = 5usize
The number of trits that fit into this trit slice encoding.
sourcefn as_i8_slice(&self) -> &[i8]
fn as_i8_slice(&self) -> &[i8]
Interpret the raw data of this encoding as a slice of
i8
.sourceunsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]
Interpret the raw data of this encoding as a mutable slice of
i8
.sourceunsafe fn get_unchecked(&self, index: usize) -> Self::Trit
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
Get the trit at the given index
sourceunsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
Set the trit at the given index
sourceunsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
Get a slice of this slice
sourceunsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
Get a mutable slice of this slice
sourceunsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
Unsafely reinterpret a slice of bytes as trit slice
sourceunsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
Unsafely reinterpret a slice of bytes as trit slice