pub struct BorrowedSliceLike<Enc: Encoding>(/* private fields */);
Expand description
A container for slice-like data with borrow constructor,
e.g. GenericArray
from generic-array=1
.
Note that the object will still be cloned, hence the Clone
requirement.
For use in the #[serde(with)]
field attribute.
Requirements:
- serializer requires the field to implement
AsRef<[u8]>
; - deserializer requires the field to implement
Clone
and&Self: TryFrom<&[u8]>
.
Implementations§
Auto Trait Implementations§
impl<Enc> Freeze for BorrowedSliceLike<Enc>
impl<Enc> RefUnwindSafe for BorrowedSliceLike<Enc>where
Enc: RefUnwindSafe,
impl<Enc> Send for BorrowedSliceLike<Enc>where
Enc: Send,
impl<Enc> Sync for BorrowedSliceLike<Enc>where
Enc: Sync,
impl<Enc> Unpin for BorrowedSliceLike<Enc>where
Enc: Unpin,
impl<Enc> UnwindSafe for BorrowedSliceLike<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