[][src]Struct iota_ternary_preview::Trits

#[repr(transparent)]pub struct Trits<T: RawEncoding + ?Sized = T1B1<Btrit>>(_);

Methods

impl<T: ?Sized> Trits<T> where
    T: RawEncoding
[src]

pub fn empty() -> &'static Self[src]

pub unsafe fn from_raw_unchecked(raw: &[i8], num_trits: usize) -> &Self[src]

pub unsafe fn from_raw_unchecked_mut(
    raw: &mut [i8],
    num_trits: usize
) -> &mut Self
[src]

pub fn try_from_raw(raw: &[i8], num_trits: usize) -> Result<&Self, Error>[src]

pub fn try_from_raw_mut(
    raw: &mut [i8],
    num_trits: usize
) -> Result<&mut Self, Error>
[src]

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]

impl<T: Trit> Trits<T1B1<T>>[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]

impl Trits<T3B1>[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<'a, T: RawEncoding + ?Sized> Debug for &'a Trits<T>[src]

impl<T: Hash + RawEncoding + ?Sized> Hash for Trits<T>[src]

impl<T: RawEncoding + ?Sized> Index<Range<usize>> for Trits<T>[src]

type Output = Self

The returned type after indexing.

impl<T: RawEncoding + ?Sized> IndexMut<Range<usize>> for Trits<T>[src]

impl<T: ?Sized, U: ?Sized> PartialEq<Trits<U>> for Trits<T> where
    T: RawEncoding,
    U: RawEncoding<Trit = T::Trit>, 
[src]

impl<T: ?Sized, U: ?Sized> PartialOrd<Trits<U>> for Trits<T> where
    T: RawEncoding,
    U: RawEncoding<Trit = T::Trit>,
    T::Trit: PartialOrd
[src]

impl<T: RawEncoding + ?Sized> ToOwned for Trits<T>[src]

type Owned = TritBuf<T::Buf>

The resulting type after obtaining ownership.

Auto Trait Implementations

impl<T: ?Sized> RefUnwindSafe for Trits<T> where
    T: RefUnwindSafe

impl<T: ?Sized> Send for Trits<T> where
    T: Send

impl<T: ?Sized> Sync for Trits<T> where
    T: Sync

impl<T: ?Sized> Unpin for Trits<T> where
    T: Unpin

impl<T: ?Sized> UnwindSafe for Trits<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>,