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 Constants§
Required Associated Types§
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so 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]>
impl<'de, const LEN: usize> MyDeserialize<'de> for SmallVec<[u8; LEN]>
This ad-hock impl parses length-encoded string into a SmallVec
.