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§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§fn size(&self, _value: &T) -> usize
fn size(&self, _value: &T) -> usize
Encoded byte size of
value. Default: encode into a throwaway buffer
and return the resulting length. Specialize for cheap-size codecs. Read moreSource§const SCHEMA_ENCODING: Option<SchemaEncoding> = None
const SCHEMA_ENCODING: Option<SchemaEncoding> = None
Encoding whose bytes are described exactly by
Typ, if declared.
Metadata-only format transitions require Rapira.Source§impl Debug for BytemuckCodec
impl Debug for BytemuckCodec
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