pub struct BoundedVec<T, const L: usize, const U: usize, W = NonEmpty<L, U>> { /* private fields */ }Expand description
Non-empty Vec bounded with minimal (L - lower bound) and maximal (U - upper bound) items quantity.
§Type Parameters
W- witness type to prove vector ranges and shape of interface accordingly
Implementations§
Source§impl<T, const U: usize> BoundedVec<T, 0, U, Empty<U>>
impl<T, const U: usize> BoundedVec<T, 0, U, Empty<U>>
Sourcepub fn from_vec(
items: Vec<T>,
) -> Result<BoundedVec<T, 0, U, Empty<U>>, BoundedVecOutOfBounds>
pub fn from_vec( items: Vec<T>, ) -> Result<BoundedVec<T, 0, U, Empty<U>>, BoundedVecOutOfBounds>
Creates new BoundedVec or returns error if items count is out of bounds
§Parameters
items- vector of items within bounds
§Errors
UpperBoundError- if `items`` len is more than U (upper bound)
§Example
use bounded_vec::BoundedVec;
use bounded_vec::witnesses;
let data: BoundedVec<_, 0, 8, witnesses::Empty<8>> =
BoundedVec::<_, 0, 8, witnesses::Empty<8>>::from_vec(vec![1u8, 2]).unwrap();Sourcepub fn first(&self) -> Option<&T>
pub fn first(&self) -> Option<&T>
Returns the first element of the vector, or None if it is empty
§Example
use bounded_vec::BoundedVec;
use bounded_vec::witnesses;
use std::convert::TryInto;
let data: BoundedVec<u8, 0, 8, witnesses::Empty<8>> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.first(), Some(&1u8));Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the vector contains no elements
§Example
use bounded_vec::BoundedVec;
use bounded_vec::witnesses;
use std::convert::TryInto;
let data: BoundedVec<u8, 0, 8, witnesses::Empty<8>> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.is_empty(), false);Sourcepub fn last(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
Returns the last element of the vector, or None if it is empty
§Example
use bounded_vec::BoundedVec;
use bounded_vec::witnesses;
use std::convert::TryInto;
let data: BoundedVec<u8, 0, 8, witnesses::Empty<8>> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.last(), Some(&2u8));Source§impl<T, const L: usize, const U: usize, W> BoundedVec<T, L, U, W>
Methods which works for all witnesses
impl<T, const L: usize, const U: usize, W> BoundedVec<T, L, U, W>
Methods which works for all witnesses
Sourcepub fn as_vec(&self) -> &Vec<T>
pub fn as_vec(&self) -> &Vec<T>
Returns a reference to underlying `Vec``
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<_, 2, 8> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.as_vec(), &vec![1u8,2]);Sourcepub fn to_vec(self) -> Vec<T>
pub fn to_vec(self) -> Vec<T>
Returns an underlying `Vec``
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<_, 2, 8> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.to_vec(), vec![1u8,2]);Sourcepub fn as_slice(&self) -> &[T]
pub fn as_slice(&self) -> &[T]
Extracts a slice containing the entire vector.
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<_, 2, 8> = vec![1u8, 2].try_into().unwrap();
assert_eq!(data.as_slice(), &[1u8,2]);Source§impl<T, const L: usize, const U: usize> BoundedVec<T, L, U>
impl<T, const L: usize, const U: usize> BoundedVec<T, L, U>
Sourcepub fn from_vec(
items: Vec<T>,
) -> Result<BoundedVec<T, L, U>, BoundedVecOutOfBounds>
pub fn from_vec( items: Vec<T>, ) -> Result<BoundedVec<T, L, U>, BoundedVecOutOfBounds>
Creates new BoundedVec or returns error if items count is out of bounds
§Parameters
items- vector of items within bounds
§Errors
LowerBoundError- if `items`` len is less than L (lower bound)UpperBoundError- if `items`` len is more than U (upper bound)
§Example
use bounded_vec::BoundedVec;
use bounded_vec::witnesses;
let data: BoundedVec<_, 2, 8, witnesses::NonEmpty<2, 8>> =
BoundedVec::<_, 2, 8, witnesses::NonEmpty<2, 8>>::from_vec(vec![1u8, 2]).unwrap();Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements in the vector
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<u8, 2, 4> = vec![1u8,2].try_into().unwrap();
assert_eq!(data.len(), 2);Sourcepub fn first(&self) -> &T
pub fn first(&self) -> &T
Returns the first element of non-empty Vec
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<_, 2, 8> = vec![1u8, 2].try_into().unwrap();
assert_eq!(*data.first(), 1);Sourcepub fn last(&self) -> &T
pub fn last(&self) -> &T
Returns the last element of non-empty Vec
§Example
use bounded_vec::BoundedVec;
use std::convert::TryInto;
let data: BoundedVec<_, 2, 8> = vec![1u8, 2].try_into().unwrap();
assert_eq!(*data.last(), 2);Sourcepub fn mapped<F, N>(self, map_fn: F) -> BoundedVec<N, L, U>where
F: FnMut(T) -> N,
pub fn mapped<F, N>(self, map_fn: F) -> BoundedVec<N, L, U>where
F: FnMut(T) -> N,
Create a new BoundedVec by consuming self and mapping each element.
This is useful as it keeps the knowledge that the length is >= U, <= L,
even through the old BoundedVec is consumed and turned into an iterator.
§Example
use bounded_vec::BoundedVec;
let data: BoundedVec<u8, 2, 8> = [1u8,2].into();
let data = data.mapped(|x|x*2);
assert_eq!(data, [2u8,4].into());Sourcepub fn mapped_ref<F, N>(&self, map_fn: F) -> BoundedVec<N, L, U>
pub fn mapped_ref<F, N>(&self, map_fn: F) -> BoundedVec<N, L, U>
Create a new BoundedVec by mapping references to the elements of self
This is useful as it keeps the knowledge that the length is >= U, <= L,
will still hold for new BoundedVec
§Example
use bounded_vec::BoundedVec;
let data: BoundedVec<u8, 2, 8> = [1u8,2].into();
let data = data.mapped_ref(|x|x*2);
assert_eq!(data, [2u8,4].into());Sourcepub fn try_mapped<F, N, E>(self, map_fn: F) -> Result<BoundedVec<N, L, U>, E>
pub fn try_mapped<F, N, E>(self, map_fn: F) -> Result<BoundedVec<N, L, U>, E>
Create a new BoundedVec by consuming self and mapping each element
to a Result.
This is useful as it keeps the knowledge that the length is preserved
even through the old BoundedVec is consumed and turned into an iterator.
As this method consumes self, returning an error means that this
vec is dropped. I.e. this method behaves roughly like using a
chain of into_iter(), map, collect::<Result<Vec<N>,E>> and
then converting the Vec back to a Vec1.
§Errors
Once any call to map_fn returns a error that error is directly
returned by this method.
§Example
use bounded_vec::BoundedVec;
let data: BoundedVec<u8, 2, 8> = [1u8,2].into();
let data: Result<BoundedVec<u8, 2, 8>, _> = data.try_mapped(|x| Err("failed"));
assert_eq!(data, Err("failed"));Sourcepub fn try_mapped_ref<F, N, E>(
&self,
map_fn: F,
) -> Result<BoundedVec<N, L, U>, E>
pub fn try_mapped_ref<F, N, E>( &self, map_fn: F, ) -> Result<BoundedVec<N, L, U>, E>
Create a new BoundedVec by mapping references of self elements
to a Result.
This is useful as it keeps the knowledge that the length is preserved
even through the old BoundedVec is consumed and turned into an iterator.
§Errors
Once any call to map_fn returns a error that error is directly
returned by this method.
§Example
use bounded_vec::BoundedVec;
let data: BoundedVec<u8, 2, 8> = [1u8,2].into();
let data: Result<BoundedVec<u8, 2, 8>, _> = data.try_mapped_ref(|x| Err("failed"));
assert_eq!(data, Err("failed"));Sourcepub fn split_last(&self) -> (&T, &[T])
pub fn split_last(&self) -> (&T, &[T])
Returns the last and all the rest of the elements
Sourcepub fn enumerated(self) -> BoundedVec<(usize, T), L, U>
pub fn enumerated(self) -> BoundedVec<(usize, T), L, U>
Return a new BoundedVec with indices included
Sourcepub fn opt_empty_vec(
v: Vec<T>,
) -> Result<Option<BoundedVec<T, L, U>>, BoundedVecOutOfBounds>
pub fn opt_empty_vec( v: Vec<T>, ) -> Result<Option<BoundedVec<T, L, U>>, BoundedVecOutOfBounds>
Return a Some(BoundedVec) or None if v is empty
§Example
use bounded_vec::BoundedVec;
use bounded_vec::OptBoundedVecToVec;
let opt_bv_none = BoundedVec::<u8, 2, 8>::opt_empty_vec(vec![]).unwrap();
assert!(opt_bv_none.is_none());
assert_eq!(opt_bv_none.to_vec(), Vec::<u8>::new());
let opt_bv_some = BoundedVec::<u8, 2, 8>::opt_empty_vec(vec![0u8, 2]).unwrap();
assert!(opt_bv_some.is_some());
assert_eq!(opt_bv_some.to_vec(), vec![0u8, 2]);Trait Implementations§
Source§impl<T, const L: usize, const U: usize, W> Clone for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> Clone for BoundedVec<T, L, U, W>
Source§fn clone(&self) -> BoundedVec<T, L, U, W>
fn clone(&self) -> BoundedVec<T, L, U, W>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, T, const U: usize> Deserialize<'de> for BoundedVec<T, 0, U, Empty<U>>where
T: Deserialize<'de>,
impl<'de, T, const U: usize> Deserialize<'de> for BoundedVec<T, 0, U, Empty<U>>where
T: Deserialize<'de>,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BoundedVec<T, 0, U, Empty<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BoundedVec<T, 0, U, Empty<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<'de, T, const L: usize, const U: usize> Deserialize<'de> for BoundedVec<T, L, U>where
T: Deserialize<'de>,
impl<'de, T, const L: usize, const U: usize> Deserialize<'de> for BoundedVec<T, L, U>where
T: Deserialize<'de>,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BoundedVec<T, L, U>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BoundedVec<T, L, U>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<T, const L: usize, const U: usize> From<[T; L]> for BoundedVec<T, L, U>
impl<T, const L: usize, const U: usize> From<[T; L]> for BoundedVec<T, L, U>
Source§fn from(arr: [T; L]) -> BoundedVec<T, L, U>
fn from(arr: [T; L]) -> BoundedVec<T, L, U>
Source§impl<T, const L: usize, const U: usize> From<BoundedVec<T, L, U>> for Vec<T>
impl<T, const L: usize, const U: usize> From<BoundedVec<T, L, U>> for Vec<T>
Source§fn from(v: BoundedVec<T, L, U>) -> Vec<T>
fn from(v: BoundedVec<T, L, U>) -> Vec<T>
Source§impl<'a, T, const L: usize, const U: usize, W> IntoIterator for &'a BoundedVec<T, L, U, W>
impl<'a, T, const L: usize, const U: usize, W> IntoIterator for &'a BoundedVec<T, L, U, W>
Source§impl<'a, T, const L: usize, const U: usize, W> IntoIterator for &'a mut BoundedVec<T, L, U, W>
impl<'a, T, const L: usize, const U: usize, W> IntoIterator for &'a mut BoundedVec<T, L, U, W>
Source§impl<T, const L: usize, const U: usize, W> IntoIterator for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> IntoIterator for BoundedVec<T, L, U, W>
Source§impl<T, const L: usize, const U: usize, W> Ord for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> Ord for BoundedVec<T, L, U, W>
Source§fn cmp(&self, other: &BoundedVec<T, L, U, W>) -> Ordering
fn cmp(&self, other: &BoundedVec<T, L, U, W>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T, const L: usize, const U: usize, W> PartialOrd for BoundedVec<T, L, U, W>where
T: PartialOrd,
W: PartialOrd,
impl<T, const L: usize, const U: usize, W> PartialOrd for BoundedVec<T, L, U, W>where
T: PartialOrd,
W: PartialOrd,
Source§impl<T, const L: usize, const U: usize, W> Serialize for BoundedVec<T, L, U, W>where
T: Serialize,
impl<T, const L: usize, const U: usize, W> Serialize for BoundedVec<T, L, U, W>where
T: Serialize,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl<T, const L: usize, const U: usize> TryFrom<Vec<T>> for BoundedVec<T, L, U>
impl<T, const L: usize, const U: usize> TryFrom<Vec<T>> for BoundedVec<T, L, U>
Source§type Error = BoundedVecOutOfBounds
type Error = BoundedVecOutOfBounds
Source§fn try_from(
value: Vec<T>,
) -> Result<BoundedVec<T, L, U>, <BoundedVec<T, L, U> as TryFrom<Vec<T>>>::Error>
fn try_from( value: Vec<T>, ) -> Result<BoundedVec<T, L, U>, <BoundedVec<T, L, U> as TryFrom<Vec<T>>>::Error>
impl<T, const L: usize, const U: usize, W> Eq for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> StructuralPartialEq for BoundedVec<T, L, U, W>
Auto Trait Implementations§
impl<T, const L: usize, const U: usize, W> Freeze for BoundedVec<T, L, U, W>where
W: Freeze,
impl<T, const L: usize, const U: usize, W> RefUnwindSafe for BoundedVec<T, L, U, W>where
W: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, const L: usize, const U: usize, W> Send for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> Sync for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> Unpin for BoundedVec<T, L, U, W>
impl<T, const L: usize, const U: usize, W> UnwindSafe for BoundedVec<T, L, U, W>where
W: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for A
Source§impl<A, T> AsMutBits<T> for A
impl<A, T> AsMutBits<T> for A
Source§fn as_mut_bits<O>(&mut self) -> &mut BitSlice<T, O> ⓘwhere
O: BitOrder,
fn as_mut_bits<O>(&mut self) -> &mut BitSlice<T, O> ⓘwhere
O: BitOrder,
self as a mutable bit-slice region with the O ordering.Source§fn try_as_mut_bits<O>(&mut self) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
fn try_as_mut_bits<O>(&mut self) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
Source§impl<'a, F, I> BatchInvert<F> for I
impl<'a, F, I> BatchInvert<F> for I
Source§fn batch_invert(self) -> F
fn batch_invert(self) -> F
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)