pub unsafe trait StatementParent { }
Expand description
Implementers of this trait are guaranteed to keep a connection alive and in connected state for the lifetime of the instance.
E.g. super::Connection
is not a StatementParent
, since it is not guaranteed to keep the
connection alive. Nor would it close the connection at the end of the lifetime on Drop.
§Safety
Instance must keep the connection it owns alive and open.
Implementations on Foreign Types§
impl StatementParent for Arc<Connection<'_>>
We need to implement StatementParent
for Arc<Connection>
in order to be able to express
ownership of a shared connection from a statement handle. This is e.g. needed for
ConnectionTransitions::into_cursor
.
§Safety:
Arc<Connection>
wraps an open Connection. It keeps the handle alive and valid during its
lifetime.
Implementors§
impl StatementParent for Connection<'_>
We need to implement StatementParent
for Connection
in order to express ownership of a
connection for a statement handle. This is e.g. needed for Connection::into_cursor
.
§Safety:
Connection wraps an open Connection. It keeps the handle alive and valid during its lifetime.
impl StatementParent for SharedConnection<'_>
§Safety:
Connection is guaranteed to be alive and in connected state for the lifetime of
SharedConnection
.