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.