pub struct AsyncPreparedStatement { /* private fields */ }Expand description
An async prepared statement.
Represents a server-side prepared statement that can be executed
multiple times with different parameters. Auto-closes on Drop
via a best-effort tokio::spawn task — if no tokio runtime is
available at drop time we log a warning and flag the connection
desynchronized rather than silently leaking the server-side
statement slot.
For callers who need confirmed close with error propagation, use
AsyncPreparedStatement::close (explicit async close).
Implementations§
Source§impl AsyncPreparedStatement
impl AsyncPreparedStatement
Sourcepub fn param_types(&self) -> &[Oid]
pub fn param_types(&self) -> &[Oid]
Returns the parameter types.
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Returns the number of parameters.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Returns the number of result columns.
Sourcepub async fn close(self, client: &AsyncClient) -> Result<()>
pub async fn close(self, client: &AsyncClient) -> Result<()>
Explicitly closes the prepared statement on the server (async).
Consumes the statement — no further execute_prepared /
execute_prepared_streaming calls are possible — and suppresses
the Drop-path auto-close. Returns the close_statement result so
callers can observe any transport errors.
If you don’t need error propagation, simply dropping the
statement has the same effect (best-effort auto-close via
tokio::spawn).
§Errors
Propagates any error from
AsyncClient::close_statement — unhealthy connection,
server-side error during Close/Sync, or transport failure.
Trait Implementations§
Source§impl Debug for AsyncPreparedStatement
impl Debug for AsyncPreparedStatement
Source§impl Drop for AsyncPreparedStatement
impl Drop for AsyncPreparedStatement
Auto Trait Implementations§
impl Freeze for AsyncPreparedStatement
impl !RefUnwindSafe for AsyncPreparedStatement
impl Send for AsyncPreparedStatement
impl Sync for AsyncPreparedStatement
impl Unpin for AsyncPreparedStatement
impl UnsafeUnpin for AsyncPreparedStatement
impl !UnwindSafe for AsyncPreparedStatement
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request