pub struct ResourceScope<'id> { /* private fields */ }Expand description
Connection-local statement and portal namespaces.
Implementations§
Source§impl<'id> ResourceScope<'id>
impl<'id> ResourceScope<'id>
Sourcepub fn simple_query_boundary(&mut self)
pub fn simple_query_boundary(&mut self)
Records a simple-query boundary, which destroys the unnamed statement.
Sourcepub fn transaction_ended(&mut self)
pub fn transaction_ended(&mut self)
Records transaction end, which destroys the unnamed portal.
Sourcepub fn prepare(
&mut self,
client_name: Bytes,
upstream_name: Bytes,
query: Bytes,
parameter_types: Vec<u32>,
) -> Result<(PreparedStatement<'id>, Parse), ResourceError>
pub fn prepare( &mut self, client_name: Bytes, upstream_name: Bytes, query: Bytes, parameter_types: Vec<u32>, ) -> Result<(PreparedStatement<'id>, Parse), ResourceError>
Allocates a statement token and reconstructable upstream Parse message.
§Errors
Rejects duplicate upstream statement names.
Sourcepub fn bind(
&mut self,
statement: &PreparedStatement<'id>,
client_name: Bytes,
upstream_name: Bytes,
parameter_formats: Vec<i16>,
parameters: Vec<Option<Bytes>>,
result_formats: Vec<i16>,
) -> Result<(Portal<'id>, Bind), ResourceError>
pub fn bind( &mut self, statement: &PreparedStatement<'id>, client_name: Bytes, upstream_name: Bytes, parameter_formats: Vec<i16>, parameters: Vec<Option<Bytes>>, result_formats: Vec<i16>, ) -> Result<(Portal<'id>, Bind), ResourceError>
Binds a branded statement into a rewritten portal namespace.
§Errors
Rejects statements not present in this scope and duplicate portal names.
Sourcepub fn close_statement(
&mut self,
statement: PreparedStatement<'id>,
) -> Result<Close, ResourceError>
pub fn close_statement( &mut self, statement: PreparedStatement<'id>, ) -> Result<Close, ResourceError>
Closes a statement and removes its upstream name from this scope.
§Errors
Rejects a token which has already been closed.
Sourcepub fn close_portal(
&mut self,
portal: Portal<'id>,
) -> Result<Close, ResourceError>
pub fn close_portal( &mut self, portal: Portal<'id>, ) -> Result<Close, ResourceError>
Closes a portal and removes its upstream name from this scope.
§Errors
Rejects a token which has already been closed.
Sourcepub fn statement(&self, client_name: &[u8]) -> Option<PreparedStatement<'id>>
pub fn statement(&self, client_name: &[u8]) -> Option<PreparedStatement<'id>>
Resolves a client-visible statement name to its branded upstream token.
Trait Implementations§
Auto Trait Implementations§
impl<'id> !RefUnwindSafe for ResourceScope<'id>
impl<'id> !Sync for ResourceScope<'id>
impl<'id> Freeze for ResourceScope<'id>
impl<'id> Send for ResourceScope<'id>
impl<'id> Unpin for ResourceScope<'id>
impl<'id> UnsafeUnpin for ResourceScope<'id>
impl<'id> UnwindSafe for ResourceScope<'id>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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