pub struct QueryResult {
pub rows: Vec<Row>,
pub affected_rows: usize,
}Expand description
Result of a query execution
Contains the rows returned by the query and metadata about the execution.
Fields§
§rows: Vec<Row>Rows returned by the query
affected_rows: usizeNumber of rows affected by the query (for INSERT, UPDATE, DELETE)
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn with_affected_rows(affected_rows: usize) -> Self
pub fn with_affected_rows(affected_rows: usize) -> Self
Create a new query result for a modification query
Sourcepub fn one(self) -> Result<Row>
pub fn one(self) -> Result<Row>
Get a single row, returning an error if zero or multiple rows exist
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryResult
impl Debug for QueryResult
Source§impl Default for QueryResult
impl Default for 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
Mutably borrows from an owned value. Read more