pub struct QueryResult { /* private fields */ }
Expand description
Defines the result of a query operation on a Model
Implementationsยง
Sourceยงimpl QueryResult
impl QueryResult
Sourcepub fn try_get_by<T, I>(&self, index: I) -> Result<T, DbErr>where
T: TryGetable,
I: ColIdx,
pub fn try_get_by<T, I>(&self, index: I) -> Result<T, DbErr>where
T: TryGetable,
I: ColIdx,
Get a value from the query result with an ColIdx
Sourcepub fn try_get<T>(&self, pre: &str, col: &str) -> Result<T, DbErr>where
T: TryGetable,
pub fn try_get<T>(&self, pre: &str, col: &str) -> Result<T, DbErr>where
T: TryGetable,
Get a value from the query result with prefixed column name
Sourcepub fn try_get_by_index<T>(&self, idx: usize) -> Result<T, DbErr>where
T: TryGetable,
pub fn try_get_by_index<T>(&self, idx: usize) -> Result<T, DbErr>where
T: TryGetable,
Get a value from the query result based on the order in the select expressions
Sourcepub fn try_get_many<T>(&self, pre: &str, cols: &[String]) -> Result<T, DbErr>where
T: TryGetableMany,
pub fn try_get_many<T>(&self, pre: &str, cols: &[String]) -> Result<T, DbErr>where
T: TryGetableMany,
Get a tuple value from the query result with prefixed column name
Sourcepub fn try_get_many_by_index<T>(&self) -> Result<T, DbErr>where
T: TryGetableMany,
pub fn try_get_many_by_index<T>(&self) -> Result<T, DbErr>where
T: TryGetableMany,
Get a tuple value from the query result based on the order in the select expressions
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Retrieves the names of the columns in the result set
Trait Implementationsยง
Sourceยงimpl Debug for QueryResult
impl Debug for QueryResult
Sourceยงimpl From<MySqlRow> for QueryResult
impl From<MySqlRow> for QueryResult
Sourceยงfn from(row: MySqlRow) -> QueryResult
fn from(row: MySqlRow) -> QueryResult
Converts to this type from the input type.
Sourceยงimpl From<PgRow> for QueryResult
impl From<PgRow> for QueryResult
Sourceยงfn from(row: PgRow) -> QueryResult
fn from(row: PgRow) -> QueryResult
Converts to this type from the input type.
Sourceยงimpl From<ProxyRow> for QueryResult
Available on crate feature proxy
only.
impl From<ProxyRow> for QueryResult
Available on crate feature
proxy
only.Sourceยงimpl From<SqliteRow> for QueryResult
impl From<SqliteRow> for QueryResult
Sourceยงfn from(row: SqliteRow) -> QueryResult
fn from(row: SqliteRow) -> QueryResult
Converts to this type from the input type.
Auto Trait Implementationsยง
impl !Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnwindSafe for QueryResult
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more