pub struct PreparedStatement<'a> { /* private fields */ }Expand description
A PostgreSQL statement rendered once, with its parameter slots, for reuse.
The SQL text uses $1, $2, … placeholders. Each slot holds either a
bound value or a named Placeholder to fill
at execution time. Values are borrowed for 'a; convert with
into_owned to keep the statement longer.
Display prints the SQL text.
Implementations§
Source§impl PreparedStatement<'_>
impl PreparedStatement<'_>
Sourcepub fn into_owned(&self) -> OwnedPreparedStatement
pub fn into_owned(&self) -> OwnedPreparedStatement
Copies this statement into an OwnedPreparedStatement with no
borrowed data.
§Examples
let owned = prepared.into_owned();
// `owned` has no lifetime, so it can be cached or sent to another thread.Trait Implementations§
Source§impl<'a> Clone for PreparedStatement<'a>
impl<'a> Clone for PreparedStatement<'a>
Source§impl<'a> Debug for PreparedStatement<'a>
impl<'a> Debug for PreparedStatement<'a>
Source§impl Display for PreparedStatement<'_>
impl Display for PreparedStatement<'_>
Source§impl From<OwnedPreparedStatement> for PreparedStatement<'_>
impl From<OwnedPreparedStatement> for PreparedStatement<'_>
Source§fn from(value: OwnedPreparedStatement) -> Self
fn from(value: OwnedPreparedStatement) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PreparedStatement<'a>> for OwnedPreparedStatement
impl<'a> From<PreparedStatement<'a>> for OwnedPreparedStatement
Source§fn from(value: PreparedStatement<'a>) -> Self
fn from(value: PreparedStatement<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PreparedStatement<'a>
impl<'a> !UnwindSafe for PreparedStatement<'a>
impl<'a> Freeze for PreparedStatement<'a>
impl<'a> Send for PreparedStatement<'a>
impl<'a> Sync for PreparedStatement<'a>
impl<'a> Unpin for PreparedStatement<'a>
impl<'a> UnsafeUnpin for PreparedStatement<'a>
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<Joined, From> JoinKey<From, JoinReverse> for Joined
impl<Joined, From> JoinKey<From, JoinReverse> for Joined
impl<List> ListIncludes<Nil, ()> for List
impl<Mk> MarkerAggValidFor<()> for Mk
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more