Trait bee_ternary::raw::RawEncodingBuf [−][src]
A trait to be implemented by alternative trit encoding scheme buffers.
Associated Types
type Slice: RawEncoding + ?Sized
[src]
The trit slice encoding associated with this trit buffer encoding.
Required methods
fn new() -> Self where
Self: Sized,
[src]
Self: Sized,
Create a new empty buffer.
fn with_capacity(cap: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
Create a new empty buffer with a given capacity.
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
[src]
Push a trit to the back of this buffer.
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
[src]
Pop a trit from the back of this buffer.
fn as_slice(&self) -> &Self::Slice
[src]
View the trits in this buffer as a slice.
fn as_slice_mut(&mut self) -> &mut Self::Slice
[src]
View the trits in this buffer as a mutable slice.
Provided methods
fn from_trits(trits: &[<Self::Slice as RawEncoding>::Trit]) -> Self where
Self: Sized,
[src]
Self: Sized,
Create a new buffer containing the given trits.
fn into_encoding<T: RawEncodingBuf>(this: TritBuf<Self>) -> TritBuf<T> where
Self: Sized,
T: RawEncodingBuf,
T::Slice: RawEncoding<Trit = <Self::Slice as RawEncoding>::Trit>,
[src]
Self: Sized,
T: RawEncodingBuf,
T::Slice: RawEncoding<Trit = <Self::Slice as RawEncoding>::Trit>,
Convert this encoding into another encoding.
TODO: Rename this reencode
Implementors
impl RawEncodingBuf for T2B1Buf
[src]
type Slice = T2B1
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
[src]
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
[src]
fn as_slice(&self) -> &Self::Slice
[src]
fn as_slice_mut(&mut self) -> &mut Self::Slice
[src]
impl RawEncodingBuf for T3B1Buf
[src]
type Slice = T3B1
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
[src]
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
[src]
fn as_slice(&self) -> &Self::Slice
[src]
fn as_slice_mut(&mut self) -> &mut Self::Slice
[src]
impl RawEncodingBuf for T4B1Buf
[src]
type Slice = T4B1
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
[src]
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
[src]
fn as_slice(&self) -> &Self::Slice
[src]
fn as_slice_mut(&mut self) -> &mut Self::Slice
[src]
impl RawEncodingBuf for T5B1Buf
[src]
type Slice = T5B1
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
[src]
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
[src]
fn as_slice(&self) -> &Self::Slice
[src]
fn as_slice_mut(&mut self) -> &mut Self::Slice
[src]
impl<T> RawEncodingBuf for T1B1Buf<T> where
T: Trit,
[src]
T: Trit,