pub struct ExecResult { /* private fields */ }Expand description
Result of a non-SELECT statement: an INSERT, UPDATE, DELETE, or
DDL execution. Carries the row count
(rows_affected) and, where the backend supports
it, the last auto-generated primary key
(last_insert_id).
Implementations§
Source§impl ExecResult
impl ExecResult
Sourcepub fn last_insert_id(&self) -> u64
pub fn last_insert_id(&self) -> u64
The auto-increment primary key value assigned by the database on the
most recent INSERT.
§Panics
PostgreSQL does not expose last_insert_id directly — use
exec_with_returning / exec_with_returning_keys instead.
Sourcepub fn rows_affected(&self) -> u64
pub fn rows_affected(&self) -> u64
Number of rows affected by the statement.
Trait Implementations§
Source§impl Debug for ExecResult
impl Debug for ExecResult
Source§impl From<ExecResult> for ProxyExecResult
Available on crate feature proxy only.
impl From<ExecResult> for ProxyExecResult
Available on crate feature
proxy only.Source§fn from(result: ExecResult) -> Self
fn from(result: ExecResult) -> Self
Converts to this type from the input type.
Source§impl From<ProxyExecResult> for ExecResult
Available on crate feature proxy only.
impl From<ProxyExecResult> for ExecResult
Available on crate feature
proxy only.Source§fn from(result: ProxyExecResult) -> Self
fn from(result: ProxyExecResult) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExecResult
impl RefUnwindSafe for ExecResult
impl Send for ExecResult
impl Sync for ExecResult
impl Unpin for ExecResult
impl UnsafeUnpin for ExecResult
impl UnwindSafe for ExecResult
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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