Trait TryGetable
pub trait TryGetable: Sized {
// Required method
fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Self, TryGetError>
where I: ColIdx;
// Provided methods
fn try_get(
res: &QueryResult,
pre: &str,
col: &str,
) -> Result<Self, TryGetError> { ... }
fn try_get_by_index(
res: &QueryResult,
index: usize,
) -> Result<Self, TryGetError> { ... }
}Expand description
An interface to get a value from the query result
Required Methods§
fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Self, TryGetError>where
I: ColIdx,
fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Self, TryGetError>where
I: ColIdx,
Get a value from the query result with an ColIdx
Provided Methods§
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
Get a value from the query result with prefixed column name
fn try_get_by_index(
res: &QueryResult,
index: usize,
) -> Result<Self, TryGetError>
fn try_get_by_index( res: &QueryResult, index: usize, ) -> Result<Self, TryGetError>
Get a value from the query result based on the order in the select expressions
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.
Implementations on Foreign Types§
§impl TryGetable for bool
impl TryGetable for bool
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<bool, TryGetError>where
I: ColIdx,
§impl TryGetable for f32
impl TryGetable for f32
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<f32, TryGetError>where
I: ColIdx,
§impl TryGetable for f64
impl TryGetable for f64
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<f64, TryGetError>where
I: ColIdx,
§impl TryGetable for i8
impl TryGetable for i8
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i8, TryGetError>where
I: ColIdx,
§impl TryGetable for i16
impl TryGetable for i16
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i16, TryGetError>where
I: ColIdx,
§impl TryGetable for i32
impl TryGetable for i32
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i32, TryGetError>where
I: ColIdx,
§impl TryGetable for i64
impl TryGetable for i64
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i64, TryGetError>where
I: ColIdx,
§impl TryGetable for u8
impl TryGetable for u8
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u8, TryGetError>where
I: ColIdx,
§impl TryGetable for u16
impl TryGetable for u16
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u16, TryGetError>where
I: ColIdx,
§impl TryGetable for u32
impl TryGetable for u32
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u32, TryGetError>where
I: ColIdx,
§impl TryGetable for u64
impl TryGetable for u64
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u64, TryGetError>where
I: ColIdx,
§impl TryGetable for String
impl TryGetable for String
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<String, TryGetError>where
I: ColIdx,
§impl TryGetable for Vec<u8>
impl TryGetable for Vec<u8>
fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<Vec<u8>, TryGetError>where
I: ColIdx,
§impl<T> TryGetable for Option<T>where
T: TryGetable,
impl<T> TryGetable for Option<T>where
T: TryGetable,
fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Option<T>, TryGetError>where
I: ColIdx,
§impl<T> TryGetable for Vec<T>where
T: TryGetableArray,
impl<T> TryGetable for Vec<T>where
T: TryGetableArray,
fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Vec<T>, TryGetError>where
I: ColIdx,
Implementors§
impl TryGetable for Value
impl TryGetable for NaiveDate
impl TryGetable for NaiveDateTime
impl TryGetable for NaiveTime
impl TryGetable for DateTime<FixedOffset>
impl TryGetable for DateTime<Local>
impl TryGetable for DateTime<Utc>
impl<T> TryGetable for Twhere
T: TryGetableFromJson,
Available on crate feature
with-json only.