Skip to main content

ConnectionSlot

Struct ConnectionSlot 

Source
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>

Source

pub fn reserve( &mut self, now: Moment, options: OperationOptions, ) -> Result<OperationPermit, ReserveError>

Reserves policy and publication capacity before protocol frame preparation.

Source

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>

Source

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.

Source

pub fn cancel( &mut self, operation: OperationId, ) -> Result<CancelOutcome, EngineError>

Cancels local observation for one accepted operation.

Source

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.

Source

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.

Source

pub fn drain_outcomes(&mut self) -> EventBatchDrain<'_, EngineOutcome<D::Frame>> ⓘ

Drains terminal operation outcomes in publication order.

Source

pub fn drain_events(&mut self) -> EventBatchDrain<'_, ConnectionEvent> ⓘ

Drains connection lifecycle events in sequence order.

Source

pub fn snapshot(&self) -> ConnectionSlotSnapshot

Returns immutable selector-independent slot state.

Source

pub const fn is_transport_open(&self) -> bool

Returns whether transport establishment completed.

Source

pub fn transport_release_ready(&self) -> bool

Returns whether the host may release the physical capability and settle closure.

Source

pub fn next_deadline(&self) -> Option<Deadline>

Returns the earliest connect, operation, drain, or shutdown deadline.

Source§

impl<D, C> ConnectionSlot<D, C>

Source

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>

Source

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>

Source

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>

Source

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.

Trait Implementations§

Source§

impl<D, C: Debug> Debug for ConnectionSlot<D, C>
where D: FrameDecoder + Debug, D::Frame: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<D, C> !Freeze for ConnectionSlot<D, C>

§

impl<D, C> !RefUnwindSafe for ConnectionSlot<D, C>

§

impl<D, C> !Send for ConnectionSlot<D, C>

§

impl<D, C> !Sync for ConnectionSlot<D, C>

§

impl<D, C> !UnwindSafe for ConnectionSlot<D, C>

§

impl<D, C> Unpin for ConnectionSlot<D, C>

§

impl<D, C> UnsafeUnpin for ConnectionSlot<D, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.