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_by_nullable<T, I>(&self, index: I) -> Result<T, TryGetError>where
T: TryGetable,
I: ColIdx,
pub fn try_get_by_nullable<T, I>(&self, index: I) -> Result<T, TryGetError>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_nullable<T>(
&self,
pre: &str,
col: &str,
) -> Result<T, TryGetError>where
T: TryGetable,
pub fn try_get_nullable<T>(
&self,
pre: &str,
col: &str,
) -> Result<T, TryGetError>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_by_index_nullable<T>(&self, idx: usize) -> Result<T, TryGetError>where
T: TryGetable,
pub fn try_get_by_index_nullable<T>(&self, idx: usize) -> Result<T, TryGetError>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
Sourcepub fn try_as_mysql_row(&self) -> Option<&MySqlRow>
pub fn try_as_mysql_row(&self) -> Option<&MySqlRow>
Access the underlying MySqlRow
if we use the MySQL backend.
Sourcepub fn try_as_pg_row(&self) -> Option<&PgRow>
pub fn try_as_pg_row(&self) -> Option<&PgRow>
Access the underlying PgRow
if we use the Postgres backend.
Sourcepub fn try_as_sqlite_row(&self) -> Option<&SqliteRow>
pub fn try_as_sqlite_row(&self) -> Option<&SqliteRow>
Access the underlying SqliteRow
if we use the SQLite backend.
Sourcepub fn try_as_mock_row(&self) -> Option<&MockRow>
pub fn try_as_mock_row(&self) -> Option<&MockRow>
Access the underlying MockRow
if we use a mock.
Sourcepub fn try_as_proxy_row(&self) -> Option<&ProxyRow>
pub fn try_as_proxy_row(&self) -> Option<&ProxyRow>
Access the underlying ProxyRow
if we use a proxy.
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
Sourceยงimpl From<PgRow> for QueryResult
impl From<PgRow> for QueryResult
Sourceยงfn from(row: PgRow) -> QueryResult
fn from(row: PgRow) -> QueryResult
Sourceยงimpl From<ProxyRow> for QueryResult
Available on crate feature proxy
only.
impl From<ProxyRow> for QueryResult
proxy
only.Sourceยงimpl From<SqliteRow> for QueryResult
impl From<SqliteRow> for QueryResult
Sourceยงfn from(row: SqliteRow) -> QueryResult
fn from(row: SqliteRow) -> QueryResult
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
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>
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>
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