pub struct ZeroCopyStrategy<T>(/* private fields */);Expand description
Serialization strategy using zerocopy for native byte order access.
Uses direct memory mapping in native byte order - not portable across endianness.
Trait Implementations§
Source§impl<T: Clone> Clone for ZeroCopyStrategy<T>
impl<T: Clone> Clone for ZeroCopyStrategy<T>
Source§fn clone(&self) -> ZeroCopyStrategy<T>
fn clone(&self) -> ZeroCopyStrategy<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for ZeroCopyStrategy<T>
Source§impl<T: Debug> Debug for ZeroCopyStrategy<T>
impl<T: Debug> Debug for ZeroCopyStrategy<T>
Source§impl<T: ZeroCopyVecValue> RawStrategy<T> for ZeroCopyStrategy<T>
impl<T: ZeroCopyVecValue> RawStrategy<T> for ZeroCopyStrategy<T>
Source§impl<T: ZeroCopyVecValue> ValueStrategy<T> for ZeroCopyStrategy<T>
impl<T: ZeroCopyVecValue> ValueStrategy<T> for ZeroCopyStrategy<T>
Source§const IS_NATIVE_LAYOUT: bool = true
const IS_NATIVE_LAYOUT: bool = true
Whether T has native memory layout (can be memcpy’d to/from bytes).
Source§fn write_to_vec(value: &T, buf: &mut Vec<u8>)
fn write_to_vec(value: &T, buf: &mut Vec<u8>)
Serializes a value by appending its byte representation to the buffer.
Source§fn write_to_slice(value: &T, dst: &mut [u8])
fn write_to_slice(value: &T, dst: &mut [u8])
Serializes a value directly into a fixed-size slice.
Auto Trait Implementations§
impl<T> Freeze for ZeroCopyStrategy<T>
impl<T> RefUnwindSafe for ZeroCopyStrategy<T>where
T: RefUnwindSafe,
impl<T> Send for ZeroCopyStrategy<T>where
T: Send,
impl<T> Sync for ZeroCopyStrategy<T>where
T: Sync,
impl<T> Unpin for ZeroCopyStrategy<T>where
T: Unpin,
impl<T> UnsafeUnpin for ZeroCopyStrategy<T>
impl<T> UnwindSafe for ZeroCopyStrategy<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more