Trait butane::FromSql [−][src]
pub trait FromSql { fn from_sql_ref(val: SqlValRef<'_>) -> Result<Self, Error>; fn from_sql(val: SqlVal) -> Result<Self, Error> { ... } }
Expand description
Used to convert a SqlVal
or SqlValRef
into another type.
The SqlVal
is consumed.
Required methods
fn from_sql_ref(val: SqlValRef<'_>) -> Result<Self, Error>
fn from_sql_ref(val: SqlValRef<'_>) -> Result<Self, Error>
Used to convert a SqlValRef into another type.
Provided methods
Used to convert a SqlVal into another type. The default
implementation calls Self::from_sql_ref(val.as_ref())
, which
may be inefficient. This method is chiefly used only for
primary keys: a more efficient implementation is unlikely to
provide benefits for types not used as primary keys.