Skip to main content

ConnectionCore

Struct ConnectionCore 

Source
pub struct ConnectionCore<F> { /* private fields */ }
Expand description

Sole deterministic mutation owner for one exact connection epoch.

Implementations§

Source§

impl<F: WriteFrame> ConnectionCore<F>

Source

pub fn new( endpoint: EndpointId, lane: LaneId, connection: ConnectionId, epoch: ConnectionEpoch, limits: ConnectionLimits, ) -> Self

Creates a live fixed-epoch owner with session-only admission.

Source

pub fn with_identity_seeds( endpoint: EndpointId, lane: LaneId, connection: ConnectionId, epoch: ConnectionEpoch, limits: ConnectionLimits, seeds: IdentitySeeds, ) -> Self

Creates a fixed epoch with deterministic identity seeds.

Source

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

Atomically reserves all operation resources before frame preparation.

Source

pub fn commit( &mut self, permit: OperationPermit, frame: F, ) -> Result<(OperationId, ConnectionTransition), FrameCommitError<F>>

Atomically transfers an affine permit and exact complete frame.

Source

pub fn front_write( &self, maximum: NonZeroUsize, ) -> Result<Option<WriteSlice<'_>>, ConnectionCoreError>

Borrows at most maximum bytes from the exact FIFO write front.

Source

pub const fn epoch(&self) -> ConnectionEpoch

Returns the exact epoch permanently owned by this aggregate.

Source

pub fn snapshot(&self) -> ConnectionSnapshot

Returns current deterministic policy state.

Source

pub const fn matching(&self) -> &OrderedVerified

Returns immutable ordered-matching state.

Source

pub const fn policy(&self) -> &ConnectionMachine

Returns read-only access to the underlying policy state for diagnostics.

Source

pub fn queued_write_frames(&self) -> usize

Returns complete frames still awaiting transport completion.

Source

pub fn front_write_is_empty(&self) -> bool

Returns whether the FIFO front can complete without transport progress.

Source

pub fn write_effect(&self, operation: OperationId) -> Option<EffectId>

Returns the internal write identity retained for an accepted operation.

Source

pub const fn buffered_write_retained_bytes(&self) -> RetainedBytes

Returns bytes retained by complete outbound frames.

Source§

impl<F: WriteFrame> ConnectionCore<F>

Source

pub fn apply( &mut self, input: ConnectionInput, ) -> Result<ConnectionTransition, ConnectionCoreError>

Applies one epoch-fenced command, timer, or transport observation.

Source

pub fn apply_reply<R>( &mut self, reply: InboundReply<R>, ) -> Result<ConnectionTransition<R>, ConnectionCoreError>

Applies one complete opaque reply through the same aggregate owner.

Source

pub fn advance_write( &mut self, epoch: ConnectionEpoch, effect: EffectId, written: usize, ) -> Result<ConnectionTransition, ConnectionCoreError>

Applies exact transport progress to both frame and policy ownership.

Source§

impl<F: WriteFrame> ConnectionCore<F>

Source

pub fn recover(&mut self) -> ConnectionRecovery<F>

Extracts every nonterminal operation and makes this aggregate unusable.

Trait Implementations§

Source§

impl<F: Debug> Debug for ConnectionCore<F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<F> !Freeze for ConnectionCore<F>

§

impl<F> !RefUnwindSafe for ConnectionCore<F>

§

impl<F> !Send for ConnectionCore<F>

§

impl<F> !Sync for ConnectionCore<F>

§

impl<F> !UnwindSafe for ConnectionCore<F>

§

impl<F> Unpin for ConnectionCore<F>
where WriteQueue<F>: Unpin, RecoveryJournal<F>: Unpin,

§

impl<F> UnsafeUnpin for ConnectionCore<F>
where WriteQueue<F>: UnsafeUnpin, RecoveryJournal<F>: UnsafeUnpin,

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.