Struct GenericArray014

Source
pub struct GenericArray014<Enc: Encoding>(/* private fields */);
Available on crate feature generic-array-014 only.
Expand description

A container for generic_array::GenericArray<...> from generic-array=0.14 (either with a fixed size or generic).

For use in the #[serde(with)] field attribute.

Note that the length of the array will be serialized as well; this is caused by serde not being able to communicate to format implementations that the array has a constant size. See https://github.com/serde-rs/serde/issues/2120 for details.

Implementations§

Source§

impl<Enc: Encoding> GenericArray014<Enc>

Source

pub fn serialize<L, S>( obj: &GenericArray<u8, L>, serializer: S, ) -> Result<S::Ok, S::Error>
where L: ArrayLength<u8>, S: Serializer,

Serializes array-like data.

Source

pub fn deserialize<'de, L, D>( deserializer: D, ) -> Result<GenericArray<u8, L>, D::Error>
where D: Deserializer<'de>, L: ArrayLength<u8>,

Deserializes into array-like data.

Auto Trait Implementations§

§

impl<Enc> Freeze for GenericArray014<Enc>

§

impl<Enc> RefUnwindSafe for GenericArray014<Enc>
where Enc: RefUnwindSafe,

§

impl<Enc> Send for GenericArray014<Enc>
where Enc: Send,

§

impl<Enc> Sync for GenericArray014<Enc>
where Enc: Sync,

§

impl<Enc> Unpin for GenericArray014<Enc>
where Enc: Unpin,

§

impl<Enc> UnwindSafe for GenericArray014<Enc>
where Enc: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.