Struct heed_types::UnalignedType
source · pub struct UnalignedType<T>(_);Expand description
Describes a slice that is totally borrowed and doesn’t depends on any memory alignment.
If you need to store a slice that does depend on memory alignment
and that can be big it is recommended to use the CowType.
To store slices, you must look at the CowSlice,
OwnedSlice or UnalignedSlice types.
Trait Implementations§
source§impl<'a, T: AnyBitPattern> BytesDecode<'a> for UnalignedType<T>
impl<'a, T: AnyBitPattern> BytesDecode<'a> for UnalignedType<T>
source§fn bytes_decode(bytes: &'a [u8]) -> Result<Self::DItem, BoxedError>
fn bytes_decode(bytes: &'a [u8]) -> Result<Self::DItem, BoxedError>
Decode the given bytes as DItem
source§impl<'a, T: NoUninit> BytesEncode<'a> for UnalignedType<T>
impl<'a, T: NoUninit> BytesEncode<'a> for UnalignedType<T>
source§fn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError>
fn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError>
Encode the given item as bytes
impl<T> Send for UnalignedType<T>
impl<T> Sync for UnalignedType<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for UnalignedType<T>where T: RefUnwindSafe,
impl<T> Unpin for UnalignedType<T>where T: Unpin,
impl<T> UnwindSafe for UnalignedType<T>where 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