Trait bee_ternary::raw::RawEncoding [−][src]
A trait to be implemented by alternative trit encoding scheme slices.
Associated Types
type Trit: Trit
[src]
The type of trit associated with this trit encoding.
type Buf: RawEncodingBuf<Slice = Self>
[src]
The trit buffer encoding associated with this trit slice encoding.
Required methods
fn empty() -> &'static Self
[src]
Get an empty slice of this encoding
fn len(&self) -> usize
[src]
Get the number of trits in this buffer
fn as_i8_slice(&self) -> &[i8]ⓘ
[src]
Interpret the raw data of this encoding as a slice of i8
.
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]ⓘ
[src]
Interpret the raw data of this encoding as a mutable slice of i8
.
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
[src]
Get the trit at the given index
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
[src]
Set the trit at the given index
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
[src]
Get a slice of this slice
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
[src]
Get a mutable slice of this slice
fn is_valid(repr: i8) -> bool
[src]
Decide whether a byte is a valid series of trits in this encoding
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
[src]
Unsafely reinterpret a slice of bytes as trit slice
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
[src]
Unsafely reinterpret a slice of bytes as trit slice
Implementors
impl RawEncoding for T2B1
[src]
type Trit = Btrit
type Buf = T2B1Buf
fn empty() -> &'static Self
[src]
fn len(&self) -> usize
[src]
fn as_i8_slice(&self) -> &[i8]ⓘ
[src]
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]ⓘ
[src]
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
[src]
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
[src]
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
[src]
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
[src]
fn is_valid(b: i8) -> bool
[src]
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
[src]
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
[src]
impl RawEncoding for T3B1
[src]
type Trit = Btrit
type Buf = T3B1Buf
fn empty() -> &'static Self
[src]
fn len(&self) -> usize
[src]
fn as_i8_slice(&self) -> &[i8]ⓘ
[src]
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]ⓘ
[src]
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
[src]
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
[src]
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
[src]
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
[src]
fn is_valid(b: i8) -> bool
[src]
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
[src]
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
[src]
impl RawEncoding for T4B1
[src]
type Trit = Btrit
type Buf = T4B1Buf
fn empty() -> &'static Self
[src]
fn len(&self) -> usize
[src]
fn as_i8_slice(&self) -> &[i8]ⓘ
[src]
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]ⓘ
[src]
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
[src]
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
[src]
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
[src]
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
[src]
fn is_valid(b: i8) -> bool
[src]
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
[src]
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
[src]
impl RawEncoding for T5B1
[src]
type Trit = Btrit
type Buf = T5B1Buf
fn empty() -> &'static Self
[src]
fn len(&self) -> usize
[src]
fn as_i8_slice(&self) -> &[i8]ⓘ
[src]
unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8]ⓘ
[src]
unsafe fn get_unchecked(&self, index: usize) -> Self::Trit
[src]
unsafe fn set_unchecked(&mut self, index: usize, trit: Self::Trit)
[src]
unsafe fn slice_unchecked(&self, range: Range<usize>) -> &Self
[src]
unsafe fn slice_unchecked_mut(&mut self, range: Range<usize>) -> &mut Self
[src]
fn is_valid(b: i8) -> bool
[src]
unsafe fn from_raw_unchecked(b: &[i8], num_trits: usize) -> &Self
[src]
unsafe fn from_raw_unchecked_mut(b: &mut [i8], num_trits: usize) -> &mut Self
[src]
impl<T> RawEncoding for T1B1<T> where
T: Trit,
[src]
T: Trit,