Trait leetcode_tui_rs::migrations::sea_orm::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§
sourcefn 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§
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