pub trait RawEncodingBuf {
    type Slice: RawEncoding + ?Sized;
    fn new() -> Self
    where
        Self: Sized
; fn with_capacity(cap: usize) -> Self
    where
        Self: Sized
; fn clear(&mut self); fn push(&mut self, trit: <Self::Slice as RawEncoding>::Trit); fn pop(&mut self) -> Option<<Self::Slice as RawEncoding>::Trit>; fn as_slice(&self) -> &Self::Slice; fn as_slice_mut(&mut self) -> &mut Self::Slice; fn capacity(&self) -> usize; fn from_trits(trits: &[<Self::Slice as RawEncoding>::Trit]) -> Self
    where
        Self: Sized
, { ... } fn into_encoding<T: RawEncodingBuf>(this: TritBuf<Self>) -> TritBuf<T>
    where
        Self: Sized,
        T: RawEncodingBuf,
        T::Slice: RawEncoding<Trit = <Self::Slice as RawEncoding>::Trit>
, { ... } }
Expand description

A trait to be implemented by alternative trit encoding scheme buffers.

Associated Types

The trit slice encoding associated with this trit buffer encoding.

Required methods

Create a new empty buffer.

Create a new empty buffer with a given capacity.

Clears the buffer, removing all values. Note that this method has no effect on the allocated capacity of the buffer.

Push a trit to the back of this buffer.

Pop a trit from the back of this buffer.

View the trits in this buffer as a slice.

View the trits in this buffer as a mutable slice.

Returns the number of trits the buffer can hold.

Provided methods

Create a new buffer containing the given trits.

Convert this encoding into another encoding. TODO: Rename this reencode

Implementors