pub struct ConnectionSlot<D, C>where
D: FrameDecoder,{ /* private fields */ }Expand description
One selector-free mutable owner for one exact connection epoch.
Implementations§
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn reserve(
&mut self,
now: Moment,
options: OperationOptions,
) -> Result<OperationPermit, ReserveError>
pub fn reserve( &mut self, now: Moment, options: OperationOptions, ) -> Result<OperationPermit, ReserveError>
Reserves policy and publication capacity before protocol frame preparation.
Sourcepub fn commit(
&mut self,
permit: OperationPermit,
frame: OutboundFrame,
) -> Result<OperationId, EngineCommitError<OutboundFrame>>
pub fn commit( &mut self, permit: OperationPermit, frame: OutboundFrame, ) -> Result<OperationId, EngineCommitError<OutboundFrame>>
Atomically transfers a permit and complete frame to this owner.
EngineCommitError::AcceptedOwnerFailure means ownership transferred and the
returned operation must not be retried even though effect publication failed.
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn open_admission(&mut self) -> Result<InputDisposition, EngineError>
pub fn open_admission(&mut self) -> Result<InputDisposition, EngineError>
Opens regular admission after the caller has established its protocol session.
Bornera mechanically requires an open application transport but does not validate
protocol negotiation. ConnectionEvent::AdmissionOpened is authoritative.
Sourcepub fn cancel(
&mut self,
operation: OperationId,
) -> Result<CancelOutcome, EngineError>
pub fn cancel( &mut self, operation: OperationId, ) -> Result<CancelOutcome, EngineError>
Cancels local observation for one accepted operation.
Sourcepub fn begin_drain(
&mut self,
deadline: Deadline,
) -> Result<InputDisposition, EngineError>
pub fn begin_drain( &mut self, deadline: Deadline, ) -> Result<InputDisposition, EngineError>
Closes admission and begins ordered draining through an absolute deadline.
The deadline spans accepted operations and bounded transport-local graceful shutdown. Reaching it forces physical release without waiting for a peer.
Sourcepub fn finalize(
&mut self,
reason: CloseReason,
) -> Result<InputDisposition, EngineError>
pub fn finalize( &mut self, reason: CloseReason, ) -> Result<InputDisposition, EngineError>
Forces mechanical closure for this exact connection epoch.
This preempts pending transport-local graceful shutdown while retaining the close reason already established by core policy.
Sourcepub fn drain_outcomes(&mut self) -> EventBatchDrain<'_, EngineOutcome<D::Frame>> ⓘ
pub fn drain_outcomes(&mut self) -> EventBatchDrain<'_, EngineOutcome<D::Frame>> ⓘ
Drains terminal operation outcomes in publication order.
Sourcepub fn drain_events(&mut self) -> EventBatchDrain<'_, ConnectionEvent> ⓘ
pub fn drain_events(&mut self) -> EventBatchDrain<'_, ConnectionEvent> ⓘ
Drains connection lifecycle events in sequence order.
Sourcepub fn snapshot(&self) -> ConnectionSlotSnapshot
pub fn snapshot(&self) -> ConnectionSlotSnapshot
Returns immutable selector-independent slot state.
Sourcepub const fn is_transport_open(&self) -> bool
pub const fn is_transport_open(&self) -> bool
Returns whether transport establishment completed.
Sourcepub fn transport_release_ready(&self) -> bool
pub fn transport_release_ready(&self) -> bool
Returns whether the host may release the physical capability and settle closure.
Sourcepub fn next_deadline(&self) -> Option<Deadline>
pub fn next_deadline(&self) -> Option<Deadline>
Returns the earliest connect, operation, drain, or shutdown deadline.
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn drive_quantum<T: SlotTransport + ?Sized>(
&mut self,
now: Moment,
transport: Option<&mut T>,
) -> Result<SlotProgress, EngineError>
pub fn drive_quantum<T: SlotTransport + ?Sized>( &mut self, now: Moment, transport: Option<&mut T>, ) -> Result<SlotProgress, EngineError>
Drives deadlines and a backend-neutral transport under the slot’s fixed work bound.
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn recover(
self,
reason: OwnerFailure,
) -> RecoveryReport<OutboundFrame, D::Frame>
pub fn recover( self, reason: OwnerFailure, ) -> RecoveryReport<OutboundFrame, D::Frame>
Explicitly transfers all remaining ownership from this slot.
The caller must first release any physical transport capability. The recovered slot is permanently unusable after this operation.
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn new(
config: ConnectionSlotConfig,
limits: ConnectionSlotLimits,
decoder: D,
classifier: C,
) -> Result<Self, FrameDecodeError<D::Error>>
pub fn new( config: ConnectionSlotConfig, limits: ConnectionSlotLimits, decoder: D, classifier: C, ) -> Result<Self, FrameDecodeError<D::Error>>
Creates selector-independent state for one exact connection epoch.
Source§impl<D, C> ConnectionSlot<D, C>
impl<D, C> ConnectionSlot<D, C>
Sourcepub fn settle_transport_closed(&mut self) -> bool
pub fn settle_transport_closed(&mut self) -> bool
Confirms that the owner released its physical capability after a close request.
Returns false when no settle-ready close request was pending. A graceful
request becomes settle-ready only after bounded shutdown progression completes
or reaches its deadline. Publication failure latches the slot and conservatively
aborts its transport state.