[−][src]Struct iota_ternary_preview::Trits
Methods
impl<T: ?Sized> Trits<T> where
T: RawEncoding,
[src]
T: RawEncoding,
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]
raw: &mut [i8],
num_trits: usize
) -> &mut Self
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]
raw: &mut [i8],
num_trits: usize
) -> Result<&mut Self, Error>
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]
&self
) -> impl DoubleEndedIterator<Item = T::Trit> + ExactSizeIterator<Item = T::Trit> + '_
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]
&mut self,
trits: &Trits<U>
)
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]
U: RawEncodingBuf,
U::Slice: RawEncoding<Trit = T::Trit>,
pub fn chunks(
&self,
chunk_len: usize
) -> impl DoubleEndedIterator<Item = &Self> + ExactSizeIterator<Item = &Self> + '_
[src]
&self,
chunk_len: usize
) -> impl DoubleEndedIterator<Item = &Self> + ExactSizeIterator<Item = &Self> + '_
pub fn encode<U>(&self) -> TritBuf<U> where
U: RawEncodingBuf,
U::Slice: RawEncoding<Trit = T::Trit>,
[src]
U: RawEncodingBuf,
U::Slice: RawEncoding<Trit = T::Trit>,
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]
&mut self,
chunk_len: usize
) -> impl Iterator<Item = &mut Self> + '_
pub fn copy_raw_bytes(
&mut self,
trits: &Trits<T1B1>,
offset: usize,
count: usize
)
[src]
&mut self,
trits: &Trits<T1B1>,
offset: usize,
count: usize
)
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]
fn borrow_mut(&mut self) -> &mut Trits<T::Slice>
[src]
impl<'a, T: RawEncoding + ?Sized> Debug for &'a Trits<T>
[src]
impl<T: Hash + RawEncoding + ?Sized> Hash for Trits<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: RawEncoding + ?Sized> Index<Range<usize>> for Trits<T>
[src]
type Output = Self
The returned type after indexing.
fn index(&self, range: Range<usize>) -> &Self::Output
[src]
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]
T: RawEncoding,
U: RawEncoding<Trit = T::Trit>,
impl<T: ?Sized, U: ?Sized> PartialOrd<Trits<U>> for Trits<T> where
T: RawEncoding,
U: RawEncoding<Trit = T::Trit>,
T::Trit: PartialOrd,
[src]
T: RawEncoding,
U: RawEncoding<Trit = T::Trit>,
T::Trit: PartialOrd,
fn partial_cmp(&self, other: &Trits<U>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: RawEncoding + ?Sized> ToOwned for Trits<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Trits<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Send for Trits<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for Trits<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for Trits<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for Trits<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,