Struct bee_ternary::t1b1::T1B1Buf
source · [−]Expand description
An encoding scheme buffer that uses a single byte to represent one trit.
Trait Implementations
sourceimpl<T> RawEncodingBuf for T1B1Buf<T>where
T: Trit,
impl<T> RawEncodingBuf for T1B1Buf<T>where
T: Trit,
sourcefn with_capacity(cap: usize) -> Self
fn with_capacity(cap: usize) -> Self
Create a new empty buffer with a given capacity.
sourcefn clear(&mut self)
fn clear(&mut self)
Clears the buffer, removing all values.
Note that this method has no effect on the allocated capacity of the buffer. Read more
sourcefn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit)
Push a trit to the back of this buffer.
sourcefn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>
Pop a trit from the back of this buffer.
sourcefn as_slice_mut(&mut self) -> &mut Self::Slice
fn as_slice_mut(&mut self) -> &mut Self::Slice
View the trits in this buffer as a mutable slice.
sourcefn from_trits(trits: &[<Self::Slice as RawEncoding>::Trit]) -> Selfwhere
Self: Sized,
fn from_trits(trits: &[<Self::Slice as RawEncoding>::Trit]) -> Selfwhere
Self: Sized,
Create a new buffer containing the given trits.
sourcefn into_encoding<T: RawEncodingBuf>(this: TritBuf<Self>) -> TritBuf<T>where
Self: Sized,
T: RawEncodingBuf,
T::Slice: RawEncoding<Trit = <Self::Slice as RawEncoding>::Trit>,
fn into_encoding<T: RawEncodingBuf>(this: TritBuf<Self>) -> TritBuf<T>where
Self: Sized,
T: RawEncodingBuf,
T::Slice: RawEncoding<Trit = <Self::Slice as RawEncoding>::Trit>,
Convert this encoding into another encoding.
TODO: Rename this
reencode
Read moreAuto Trait Implementations
impl<T> RefUnwindSafe for T1B1Buf<T>where
T: RefUnwindSafe,
impl<T> Send for T1B1Buf<T>where
T: Send,
impl<T> Sync for T1B1Buf<T>where
T: Sync,
impl<T> Unpin for T1B1Buf<T>where
T: Unpin,
impl<T> UnwindSafe for T1B1Buf<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more