Struct bee_message::payload::indexation::PaddedIndex [−][src]
pub struct PaddedIndex(_);
Expand description
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
)
pub fn as_slice(&self) -> &[T]ⓘ
[src]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
)
pub fn each_ref(&self) -> [&T; N]
[src]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]
fn clone(&self) -> PaddedIndex
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for PaddedIndex
[src]
impl Debug for PaddedIndex
[src]impl Deref for PaddedIndex
[src]
impl Deref for PaddedIndex
[src]impl Display for PaddedIndex
[src]
impl Display 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 eq(&self, other: &PaddedIndex) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &PaddedIndex) -> bool
[src]
fn ne(&self, other: &PaddedIndex) -> bool
[src]This method tests for !=
.
impl Copy for PaddedIndex
[src]
impl Eq for PaddedIndex
[src]
impl StructuralEq for PaddedIndex
[src]
impl StructuralPartialEq for PaddedIndex
[src]
Auto Trait Implementations
impl RefUnwindSafe for PaddedIndex
impl Send for PaddedIndex
impl Sync for PaddedIndex
impl Unpin for PaddedIndex
impl UnwindSafe for PaddedIndex
Blanket Implementations
impl<T> Base32Len for T where
T: AsRef<[u8]>,
[src]
impl<T> Base32Len for T where
T: AsRef<[u8]>,
[src]pub fn base32_len(&self) -> usize
[src]
pub fn base32_len(&self) -> usize
[src]Calculate the base32 serialized length
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type 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]
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
[src]Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
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]
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more