pub struct Statement { /* private fields */ }Expand description
A prepared statement.
Implementations§
Source§impl Statement
impl Statement
Sourcepub async fn query(&mut self, params: impl IntoParams) -> Result<Rows>
pub async fn query(&mut self, params: impl IntoParams) -> Result<Rows>
Query the database with this prepared statement.
Sourcepub async fn execute(&mut self, params: impl IntoParams) -> Result<u64>
pub async fn execute(&mut self, params: impl IntoParams) -> Result<u64>
Execute this prepared statement.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Returns the number of columns in the result set.
Sourcepub fn column_name(&self, idx: usize) -> Result<String>
pub fn column_name(&self, idx: usize) -> Result<String>
Returns the name of the column at the given index.
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Returns the names of all columns in the result set.
Sourcepub fn column_index(&self, name: &str) -> Result<usize>
pub fn column_index(&self, name: &str) -> Result<usize>
Returns the index of the column with the given name.
Sourcepub fn reset(&self) -> Result<()>
pub fn reset(&self) -> Result<()>
Reset internal statement state after previous execution so it can be reused again
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Statement
impl !RefUnwindSafe for Statement
impl !UnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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