Trait mysql_common::proto::MyDeserialize [−][src]
pub trait MyDeserialize<'de>: Sized {
type Ctx;
const SIZE: Option<usize>;
fn deserialize(ctx: Self::Ctx, buf: &mut ParseBuf<'de>) -> Result<Self>;
}
Expand description
Deserialization for various MySql types.
Associated Types
Associated Constants
Required methods
fn 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.
Implementations on Foreign Types
This ad-hock impl parses length-encoded string into a SmallVec
.