pub trait Queryable: Sized {
// Required method
fn decode(value: &Value) -> Result<Self, DecodeError>;
}Expand description
A type a query result can be decoded into — implemented for the scalars
Pylon returns, for Option/Vec of those, and derivable for a row
struct or a schema enum with #[derive(Queryable)].
Required Methods§
fn decode(value: &Value) -> Result<Self, DecodeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Queryable for NaiveDateTime
impl Queryable for NaiveDateTime
Source§impl<T: Queryable> Queryable for Option<T>
An empty set decodes as None; anything else has to decode as T.
impl<T: Queryable> Queryable for Option<T>
An empty set decodes as None; anything else has to decode as T.
Source§impl<T: Queryable> Queryable for Vec<T>
A multi pointer or any other set-valued result. A single (non-Array)
value decodes as a one-element Vec — a shape’s cardinality is the
query’s business, and rejecting it here would make Vec<T> unusable for
a pointer Pylon happens to return unwrapped.
impl<T: Queryable> Queryable for Vec<T>
A multi pointer or any other set-valued result. A single (non-Array)
value decodes as a one-element Vec — a shape’s cardinality is the
query’s business, and rejecting it here would make Vec<T> unusable for
a pointer Pylon happens to return unwrapped.