[][src]Trait sqlx::decode::Decode

pub trait Decode<DB> where
    DB: Database + ?Sized
{ fn decode(raw: &[u8]) -> Result<Self, DecodeError>; fn decode_null() -> Result<Self, DecodeError> { ... }
fn decode_nullable(raw: Option<&[u8]>) -> Result<Self, DecodeError> { ... } }

Decode a single value from the database.

Required methods

fn decode(raw: &[u8]) -> Result<Self, DecodeError>

Loading content...

Provided methods

fn decode_null() -> Result<Self, DecodeError>

Creates a new value of this type from a NULL SQL value.

The default implementation returns [DecodeError::UnexpectedNull].

fn decode_nullable(raw: Option<&[u8]>) -> Result<Self, DecodeError>

Loading content...

Implementations on Foreign Types

impl<T, DB> Decode<DB> for Option<T> where
    DB: Database + HasSqlType<T>,
    T: Decode<DB>, 
[src]

Loading content...

Implementors

Loading content...