pub struct BatchResult<R> { /* private fields */ }Expand description
What one statement of a batch did, and the rows it returned.
Generic over the driver’s row type, which only the driver can name; each driver exposes it as its own alias.
Implementations§
Source§impl<R> BatchResult<R>
impl<R> BatchResult<R>
Sourcepub fn new(rows: Vec<R>, result: QueryResult) -> Self
pub fn new(rows: Vec<R>, result: QueryResult) -> Self
A statement’s rows and what it did.
Sourcepub fn rows(&self) -> &[R]
pub fn rows(&self) -> &[R]
The rows the statement returned: a SELECT’s, or an INSERT ... RETURNING’s. Empty for a statement that returns none.
Sourcepub fn result(&self) -> &QueryResult
pub fn result(&self) -> &QueryResult
What the statement did.
Sourcepub fn into_parts(self) -> (Vec<R>, QueryResult)
pub fn into_parts(self) -> (Vec<R>, QueryResult)
The rows and what the statement did.
Trait Implementations§
Source§impl<R: Clone> Clone for BatchResult<R>
impl<R: Clone> Clone for BatchResult<R>
Auto Trait Implementations§
impl<R> Freeze for BatchResult<R>
impl<R> RefUnwindSafe for BatchResult<R>where
Vec<R>: RefUnwindSafe,
impl<R> Send for BatchResult<R>
impl<R> Sync for BatchResult<R>
impl<R> Unpin for BatchResult<R>
impl<R> UnsafeUnpin for BatchResult<R>where
Vec<R>: UnsafeUnpin,
impl<R> UnwindSafe for BatchResult<R>where
Vec<R>: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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