pub struct ArrayLike<Enc: Encoding>(/* private fields */);
Expand description
A container for array-like data, e.g. Rust stack arrays, or generic_array::GenericArray<...>
.
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.
Requirements:
- serializer requires the field to implement
AsRef<[u8]>
; - deserializer requires the field to implement
TryFromArray
orTryFrom<[u8; N]>
.
Implementations§
Auto Trait Implementations§
impl<Enc> Freeze for ArrayLike<Enc>
impl<Enc> RefUnwindSafe for ArrayLike<Enc>where
Enc: RefUnwindSafe,
impl<Enc> Send for ArrayLike<Enc>where
Enc: Send,
impl<Enc> Sync for ArrayLike<Enc>where
Enc: Sync,
impl<Enc> Unpin for ArrayLike<Enc>where
Enc: Unpin,
impl<Enc> UnwindSafe for ArrayLike<Enc>where
Enc: 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