Struct bee_message::prelude::PaddedIndex [−][src]
pub struct PaddedIndex(_);
An indexation payload index padded with 0 up to the maximum length.
Implementations
Methods from Deref<Target = [u8; 64]>
pub fn as_slice(&self) -> &[T]ⓘ[src]
🔬 This is a nightly-only experimental API. (
array_methods)Returns a slice containing the entire array. Equivalent to &s[..].
pub fn each_ref(&self) -> [&T; N][src]
🔬 This is a nightly-only experimental API. (
array_methods)Borrows each element and returns an array of references with the same
size as self.
Example
#![feature(array_methods)] let floats = [3.1, 2.7, -1.0]; let float_refs: [&f64; 3] = floats.each_ref(); assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
This method is particularly useful if combined with other methods, like
map. This way, you can avoid moving the original
array if its elements are not Copy.
#![feature(array_methods, array_map)] let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()]; let is_ascii = strings.each_ref().map(|s| s.is_ascii()); assert_eq!(is_ascii, [true, false, true]); // We can still access the original array: it has not been moved. assert_eq!(strings.len(), 3);
Trait Implementations
impl Clone for PaddedIndex[src]
impl Clone for PaddedIndex[src]fn clone(&self) -> PaddedIndex[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for PaddedIndex[src]
impl Copy for PaddedIndex[src]impl Deref for PaddedIndex[src]
impl Deref for PaddedIndex[src]impl Eq for PaddedIndex[src]
impl Eq for PaddedIndex[src]impl Hash for PaddedIndex[src]
impl Hash for PaddedIndex[src]impl PartialEq<PaddedIndex> for PaddedIndex[src]
impl PartialEq<PaddedIndex> for PaddedIndex[src]fn eq(&self, other: &PaddedIndex) -> bool[src]
fn ne(&self, other: &PaddedIndex) -> bool[src]
impl StructuralEq for PaddedIndex[src]
impl StructuralEq for PaddedIndex[src]impl StructuralPartialEq for PaddedIndex[src]
impl StructuralPartialEq for PaddedIndex[src]Auto Trait Implementations
impl RefUnwindSafe for PaddedIndex
impl RefUnwindSafe for PaddedIndeximpl Send for PaddedIndex
impl Send for PaddedIndeximpl Sync for PaddedIndex
impl Sync for PaddedIndeximpl Unpin for PaddedIndex
impl Unpin for PaddedIndeximpl UnwindSafe for PaddedIndex
impl UnwindSafe for PaddedIndexBlanket Implementations
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
Should always be Self
impl<T> ToBase32 for T where
T: AsRef<[u8]>, [src]
impl<T> ToBase32 for T where
T: AsRef<[u8]>, [src]pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32, [src]
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
pub fn to_base32(&self) -> Vec<u5, Global>[src]
impl<T> ToHex for T where
T: AsRef<[u8]>, [src]
impl<T> ToHex for T where
T: AsRef<[u8]>, [src]pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>, [src]
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>, [src]
U: FromIterator<char>,