pub struct SliceLike<Enc: Encoding>(/* private fields */);
Expand description
A container for slice-like data, e.g. Vec<u8>
or Box<u8>
.
For use in the #[serde(with)]
field attribute.
Requirements:
- serializer requires the field to implement
AsRef<[u8]>
; - deserializer requires the field to implement
TryFromSliceRef
orTryFrom<&[u8]>
.
Implementations§
Auto Trait Implementations§
impl<Enc> Freeze for SliceLike<Enc>
impl<Enc> RefUnwindSafe for SliceLike<Enc>where
Enc: RefUnwindSafe,
impl<Enc> Send for SliceLike<Enc>where
Enc: Send,
impl<Enc> Sync for SliceLike<Enc>where
Enc: Sync,
impl<Enc> Unpin for SliceLike<Enc>where
Enc: Unpin,
impl<Enc> UnwindSafe for SliceLike<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