pub struct HookSlot<'t>(/* private fields */);Expand description
Where a released SavepointOp’s staged commit hooks fold into.
Returned as the second half of
AtomicOperation::savepoint_parts,
paired with the connection the savepoint runs on. It is deliberately opaque:
the only things an implementor outside this crate can do with one are
forward a slot obtained from an operation it wraps, or declare that it has
no hook buffer via unsupported.
The pairing is the point. A savepoint needs a &mut to the connection and
a &mut to the hook buffer, held simultaneously for its whole lifetime. Two
separate &mut self accessors could never hand out both at once; returning
them together lets the implementor split the borrow across its own disjoint
fields, where the compiler permits it, and pass the result across the trait
boundary already split.
Implementations§
Source§impl HookSlot<'_>
impl HookSlot<'_>
Sourcepub fn unsupported() -> Self
pub fn unsupported() -> Self
Declares that this operation has no commit-hook buffer.
Savepoints taken through it still work at the database level; they simply
report supports_hooks as false and
refuse add_commit_hook, so callers
take their force_execute_pre_commit fallback — the same path they
already take on the operation itself.
Auto Trait Implementations§
impl<'t> !RefUnwindSafe for HookSlot<'t>
impl<'t> !Sync for HookSlot<'t>
impl<'t> !UnwindSafe for HookSlot<'t>
impl<'t> Freeze for HookSlot<'t>
impl<'t> Send for HookSlot<'t>
impl<'t> Unpin for HookSlot<'t>
impl<'t> UnsafeUnpin for HookSlot<'t>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more