pub struct FixedSizeVariantArray<A, T>(/* private fields */)
where
A: AsRef<[T]>,
T: FixedSizeVariantType;
Expand description
Wrapper type for fixed size type arrays.
Converting this from/to a Variant
is generally more efficient than working on the type
directly. This is especially important when deriving Variant
trait implementations on custom
types.
This wrapper type can hold for example Vec<u8>
, Box<[u8]>
and similar types.
Implementations§
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> FixedSizeVariantArray<A, T>
pub fn into_inner(self) -> A
Trait Implementations§
Source§impl<A: AsRef<[T]> + AsMut<[T]>, T: FixedSizeVariantType> AsMut<[T]> for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]> + AsMut<[T]>, T: FixedSizeVariantType> AsMut<[T]> for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsMut<A> for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsMut<A> for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsRef<[T]> for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsRef<[T]> for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsRef<A> for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> AsRef<A> for FixedSizeVariantArray<A, T>
Source§impl<A, T> Clone for FixedSizeVariantArray<A, T>
impl<A, T> Clone for FixedSizeVariantArray<A, T>
Source§fn clone(&self) -> FixedSizeVariantArray<A, T>
fn clone(&self) -> FixedSizeVariantArray<A, T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<A, T> Debug for FixedSizeVariantArray<A, T>
impl<A, T> Debug for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> Deref for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> Deref for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> DerefMut for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> DerefMut for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> From<A> for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> From<A> for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> From<FixedSizeVariantArray<A, T>> for Variant
impl<A: AsRef<[T]>, T: FixedSizeVariantType> From<FixedSizeVariantArray<A, T>> for Variant
Source§fn from(a: FixedSizeVariantArray<A, T>) -> Self
fn from(a: FixedSizeVariantArray<A, T>) -> Self
Converts to this type from the input type.
Source§impl<A: AsRef<[T]> + for<'a> From<&'a [T]>, T: FixedSizeVariantType> FromVariant for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]> + for<'a> From<&'a [T]>, T: FixedSizeVariantType> FromVariant for FixedSizeVariantArray<A, T>
Source§impl<A, T> Hash for FixedSizeVariantArray<A, T>
impl<A, T> Hash for FixedSizeVariantArray<A, T>
Source§impl<A, T> Ord for FixedSizeVariantArray<A, T>
impl<A, T> Ord for FixedSizeVariantArray<A, T>
Source§fn cmp(&self, other: &FixedSizeVariantArray<A, T>) -> Ordering
fn cmp(&self, other: &FixedSizeVariantArray<A, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<A, T> PartialEq for FixedSizeVariantArray<A, T>
impl<A, T> PartialEq for FixedSizeVariantArray<A, T>
Source§impl<A, T> PartialOrd for FixedSizeVariantArray<A, T>
impl<A, T> PartialOrd for FixedSizeVariantArray<A, T>
Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> StaticVariantType for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> StaticVariantType for FixedSizeVariantArray<A, T>
Source§fn static_variant_type() -> Cow<'static, VariantTy>
fn static_variant_type() -> Cow<'static, VariantTy>
Returns the
VariantType
corresponding to Self
.Source§impl<A: AsRef<[T]>, T: FixedSizeVariantType> ToVariant for FixedSizeVariantArray<A, T>
impl<A: AsRef<[T]>, T: FixedSizeVariantType> ToVariant for FixedSizeVariantArray<A, T>
Source§fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
Returns a
Variant
clone of self
.impl<A, T> Copy for FixedSizeVariantArray<A, T>
impl<A, T> Eq for FixedSizeVariantArray<A, T>
impl<A, T> StructuralPartialEq for FixedSizeVariantArray<A, T>
Auto Trait Implementations§
impl<A, T> Freeze for FixedSizeVariantArray<A, T>where
A: Freeze,
impl<A, T> RefUnwindSafe for FixedSizeVariantArray<A, T>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<A, T> Send for FixedSizeVariantArray<A, T>
impl<A, T> Sync for FixedSizeVariantArray<A, T>
impl<A, T> Unpin for FixedSizeVariantArray<A, T>
impl<A, T> UnwindSafe for FixedSizeVariantArray<A, T>where
A: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more