Struct deadpool_postgres::StatementCache [−][src]
pub struct StatementCache { /* fields omitted */ }
Expand description
This structure provides access to the statement cache. The statement cache is bound to one client and statements generated by one client must not be used with other clients.
It can be used like that:
ⓘ
let client = pool.get().await?; let stmt = client .statement_cache .prepare(&client, "SELECT 1") .await; let rows = client.query(stmt, &[]).await?; ... Normally you probably want to use the `prepare_cached` and `prepare_typed_cached` methods from the `ClientWrapper` and `Transaction` structs instead.
Implementations
impl StatementCache
[src]
impl StatementCache
[src]pub fn clear(&self)
[src]
pub fn clear(&self)
[src]Clear cache
Important: This only clears the statement cache of one client
instance. If you want to clear the statement cache of all clients
you should be calling pool.manager().statement_caches.clear()
instead.
pub fn remove(&self, query: &str, types: &[Type]) -> Option<Statement>
[src]
pub fn remove(&self, query: &str, types: &[Type]) -> Option<Statement>
[src]Remove statement from cache
Important: This only removes the statement from one client
cache. If you want to remove a statement from all statement caches
you should be calling pool.manager().statement_caches.remove()
instead.
Auto Trait Implementations
impl RefUnwindSafe for StatementCache
impl Send for StatementCache
impl Sync for StatementCache
impl Unpin for StatementCache
impl UnwindSafe for StatementCache
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,