Trait TryGetable

Source
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§

Source

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§

Source

fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>

Get a value from the query result with prefixed column name

Source

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§

Source§

impl TryGetable for bool

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<bool, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for f32

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<f32, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for f64

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<f64, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for i8

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i8, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for i16

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i16, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for i32

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i32, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for i64

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<i64, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for u8

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u8, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for u16

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u16, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for u32

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u32, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for u64

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<u64, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for String

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<String, TryGetError>
where I: ColIdx,

Source§

impl TryGetable for Vec<u8>

Source§

fn try_get_by<I>(res: &QueryResult, idx: I) -> Result<Vec<u8>, TryGetError>
where I: ColIdx,

Source§

impl<T> TryGetable for Option<T>
where T: TryGetable,

Source§

fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Option<T>, TryGetError>
where I: ColIdx,

Source§

impl<T> TryGetable for Vec<T>
where T: TryGetableArray,

Source§

fn try_get_by<I>(res: &QueryResult, index: I) -> Result<Vec<T>, TryGetError>
where I: ColIdx,

Implementors§