pub trait TryGetable: Sized {
// Required method
fn try_get_by<I: ColIdx>(
res: &QueryResult,
index: I,
) -> Result<Self, TryGetError>;
// 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ยง
Sourcefn try_get_by<I: ColIdx>(
res: &QueryResult,
index: I,
) -> Result<Self, TryGetError>
fn try_get_by<I: ColIdx>( res: &QueryResult, index: I, ) -> Result<Self, TryGetError>
Get a value from the query result with an ColIdx
Provided Methodsยง
Sourcefn 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
Sourcefn 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.