[][src]Struct iota_ternary_preview::TritBuf

#[repr(transparent)]pub struct TritBuf<T: RawEncodingBuf = T1B1Buf<Btrit>>(_);

Methods

impl<T: RawEncodingBuf> TritBuf<T>[src]

pub fn new() -> Self[src]

pub fn filled(len: usize, trit: <T::Slice as RawEncoding>::Trit) -> Self[src]

pub fn zeros(len: usize) -> Self[src]

pub fn from_trits(trits: &[<T::Slice as RawEncoding>::Trit]) -> Self[src]

pub fn from_i8_unchecked(trits: &[i8]) -> Self[src]

Deprecated

pub fn push(&mut self, trit: <T::Slice as RawEncoding>::Trit)[src]

pub fn pop(&mut self) -> Option<<T::Slice as RawEncoding>::Trit>[src]

pub fn as_slice(&self) -> &Trits<T::Slice>[src]

pub fn as_slice_mut(&mut self) -> &mut Trits<T::Slice>[src]

impl<T> TritBuf<T1B1Buf<T>> where
    T: Trit,
    T::Target: Trit
[src]

Methods from Deref<Target = Trits<T::Slice>>

pub fn len(&self) -> usize[src]

pub fn as_i8_slice(&self) -> &[i8][src]

Will panic if slice is not byte-aligned

pub unsafe fn as_i8_slice_mut(&mut self) -> &mut [i8][src]

Will panic if slice is not byte-aligned

pub unsafe fn get_unchecked(&self, index: usize) -> T::Trit[src]

pub unsafe fn set_unchecked(&mut self, index: usize, trit: T::Trit)[src]

pub fn get(&self, index: usize) -> Option<T::Trit>[src]

pub fn set(&mut self, index: usize, trit: T::Trit)[src]

pub fn trits(
    &self
) -> impl DoubleEndedIterator<Item = T::Trit> + ExactSizeIterator<Item = T::Trit> + '_
[src]

pub fn slice(&self, range: Range<usize>) -> &Self[src]

pub fn slice_mut(&mut self, range: Range<usize>) -> &mut Self[src]

pub fn copy_from<U: RawEncoding<Trit = T::Trit> + ?Sized>(
    &mut self,
    trits: &Trits<U>
)
[src]

pub fn fill(&mut self, trit: T::Trit)[src]

pub fn to_buf<U>(&self) -> TritBuf<U> where
    U: RawEncodingBuf,
    U::Slice: RawEncoding<Trit = T::Trit>, 
[src]

pub fn chunks(
    &self,
    chunk_len: usize
) -> impl DoubleEndedIterator<Item = &Self> + ExactSizeIterator<Item = &Self> + '_
[src]

pub fn encode<U>(&self) -> TritBuf<U> where
    U: RawEncodingBuf,
    U::Slice: RawEncoding<Trit = T::Trit>, 
[src]

pub fn as_raw_slice(&self) -> &[T][src]

pub fn as_raw_slice_mut(&mut self) -> &mut [T][src]

pub fn chunks_mut(
    &mut self,
    chunk_len: usize
) -> impl Iterator<Item = &mut Self> + '_
[src]

pub fn copy_raw_bytes(
    &mut self,
    trits: &Trits<T1B1>,
    offset: usize,
    count: usize
)
[src]

pub fn iter<'a>(&'a self) -> Iter<'a, T>[src]

pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T>[src]

pub fn as_trytes(&self) -> &[Tryte][src]

Will panic if the trit slice is not a multiple of 3 in length, or if the trit slice is not byte-aligned.

pub fn as_trytes_mut(&mut self) -> &mut [Tryte][src]

Will panic if the trit slice is not a multiple of 3 in length, or if the trit slice is not byte-aligned.

Trait Implementations

impl<T: RawEncodingBuf> Borrow<Trits<<T as RawEncodingBuf>::Slice>> for TritBuf<T>[src]

impl<T: RawEncodingBuf> BorrowMut<Trits<<T as RawEncodingBuf>::Slice>> for TritBuf<T>[src]

impl<T: Clone + RawEncodingBuf> Clone for TritBuf<T>[src]

impl<T: RawEncodingBuf> Debug for TritBuf<T>[src]

impl<T: RawEncodingBuf> Deref for TritBuf<T>[src]

type Target = Trits<T::Slice>

The resulting type after dereferencing.

impl<T: RawEncodingBuf> DerefMut for TritBuf<T>[src]

impl From<i64> for TritBuf<T1B1Buf>[src]

impl<T: RawEncodingBuf> FromIterator<<<T as RawEncodingBuf>::Slice as RawEncoding>::Trit> for TritBuf<T>[src]

impl<T> Hash for TritBuf<T> where
    T: RawEncodingBuf,
    T::Slice: Hash
[src]

impl<T: RawEncodingBuf> Index<Range<usize>> for TritBuf<T>[src]

type Output = Trits<T::Slice>

The returned type after indexing.

impl<T: RawEncodingBuf> IndexMut<Range<usize>> for TritBuf<T>[src]

impl<T: RawEncodingBuf, U: RawEncodingBuf> PartialEq<TritBuf<U>> for TritBuf<T> where
    T::Slice: RawEncoding,
    U::Slice: RawEncoding<Trit = <T::Slice as RawEncoding>::Trit>, 
[src]

impl TryFrom<TritBuf<T1B1Buf<Btrit>>> for i64[src]

type Error = TritsI64ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for TritBuf<T> where
    T: RefUnwindSafe

impl<T> Send for TritBuf<T> where
    T: Send

impl<T> Sync for TritBuf<T> where
    T: Sync

impl<T> Unpin for TritBuf<T> where
    T: Unpin

impl<T> UnwindSafe for TritBuf<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,