Struct bee_ternary::t2b1::T2B1Buf
source · [−]pub struct T2B1Buf(_, _);
Expand description
An encoding scheme buffer that uses a single byte to represent two trits.
Trait Implementations
sourceimpl RawEncodingBuf for T2B1Buf
impl RawEncodingBuf for T2B1Buf
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 RefUnwindSafe for T2B1Buf
impl Send for T2B1Buf
impl Sync for T2B1Buf
impl Unpin for T2B1Buf
impl UnwindSafe for T2B1Buf
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