Trait mysql_common::proto::MyDeserialize
source · pub trait MyDeserialize<'de>: Sized {
type Ctx;
const SIZE: Option<usize>;
// Required method
fn deserialize(ctx: Self::Ctx, buf: &mut ParseBuf<'de>) -> Result<Self>;
}
Expand description
Deserialization for various MySql types.
Required Associated Types§
Required Associated Constants§
Required Methods§
sourcefn deserialize(ctx: Self::Ctx, buf: &mut ParseBuf<'de>) -> Result<Self>
fn deserialize(ctx: Self::Ctx, buf: &mut ParseBuf<'de>) -> Result<Self>
Deserializes self from the given buf
.
Imlementation must consume corresponding amount of bytes from the buf
.
Panic
Implementation must panic on insufficient buffer length if Self::SIZE.is_some()
.
One should use ParseBuf::checked_parse
for checked deserialization.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'de> MyDeserialize<'de> for &'de [u8]
impl<'de> MyDeserialize<'de> for &'de [u8]
source§impl<'de> MyDeserialize<'de> for f64
impl<'de> MyDeserialize<'de> for f64
source§impl<'de, const LEN: usize> MyDeserialize<'de> for SmallVec<[u8; LEN]>where
[u8; LEN]: Array<Item = u8>,
impl<'de, const LEN: usize> MyDeserialize<'de> for SmallVec<[u8; LEN]>where [u8; LEN]: Array<Item = u8>,
This ad-hock impl parses length-encoded string into a SmallVec
.