pub struct ClientPrepared { /* private fields */ }Expand description
Tracks the client-side → canonical name mapping for a single client session.
Implementations§
Source§impl ClientPrepared
impl ClientPrepared
pub fn new() -> Self
Sourcepub fn register(&mut self, parse: &Parse, store: &mut StatementStore) -> String
pub fn register(&mut self, parse: &Parse, store: &mut StatementStore) -> String
Register a client-side name for a Parse, returning the canonical name.
Works for both named and unnamed ("") statements — unnamed
entries are tracked the same way so Bind("") in a subsequent
transaction resolves to the canonical name and gets re-prepared
on a fresh server connection automatically.
Sourcepub fn resolve(&self, client_name: &str) -> Option<&str>
pub fn resolve(&self, client_name: &str) -> Option<&str>
Look up the canonical name for a client-side statement name.
Returns None if the name isn’t tracked (first use, or the
client never sent a Parse for it).
Sourcepub fn remove(&mut self, client_name: &str, store: &mut StatementStore)
pub fn remove(&mut self, client_name: &str, store: &mut StatementStore)
Remove a client-side name mapping (client sent Close for this statement).
Sourcepub fn release_all(&mut self, store: &mut StatementStore)
pub fn release_all(&mut self, store: &mut StatementStore)
Release all references held by this client. Call when the client disconnects to allow the global store to reclaim memory.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ClientPrepared
impl Freeze for ClientPrepared
impl Move for ClientPrepared
impl RefUnwindSafe for ClientPrepared
impl Send for ClientPrepared
impl Sync for ClientPrepared
impl Unpin for ClientPrepared
impl UnsafeUnpin for ClientPrepared
impl UnwindSafe for ClientPrepared
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