pub struct BytemuckCodec;Expand description
Codec for T: bytemuck::Pod — fixed-size values cast as raw bytes.
Zero-cost conversion via bytemuck::bytes_of / try_from_bytes.
For variable-length vectors use BytemuckSliceCodec instead.
Trait Implementations§
Source§impl Clone for BytemuckCodec
impl Clone for BytemuckCodec
Source§fn clone(&self) -> BytemuckCodec
fn clone(&self) -> BytemuckCodec
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 moreSource§impl<T: Pod> Codec<T> for BytemuckCodec
Available on crate feature bytemuck-codec only.
impl<T: Pod> Codec<T> for BytemuckCodec
Available on crate feature
bytemuck-codec only.Source§const INSPECTION_ENCODING: InspectionEncoding = InspectionEncoding::RawLayout
const INSPECTION_ENCODING: InspectionEncoding = InspectionEncoding::RawLayout
Declares how inspection should interpret encoded bytes for this codec.
Source§fn encode_to(&self, value: &T, buf: &mut Vec<u8>) -> DbResult<()>
fn encode_to(&self, value: &T, buf: &mut Vec<u8>) -> DbResult<()>
Encode
value into buf. Implementations must clear buf before writing —
the caller may pass a reusable buffer.fn decode_from(&self, bytes: &[u8]) -> DbResult<T>
Source§impl Debug for BytemuckCodec
impl Debug for BytemuckCodec
Source§impl Default for BytemuckCodec
impl Default for BytemuckCodec
Source§fn default() -> BytemuckCodec
fn default() -> BytemuckCodec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BytemuckCodec
impl RefUnwindSafe for BytemuckCodec
impl Send for BytemuckCodec
impl Sync for BytemuckCodec
impl Unpin for BytemuckCodec
impl UnsafeUnpin for BytemuckCodec
impl UnwindSafe for BytemuckCodec
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