pub struct ConnectionCore<F> { /* private fields */ }Expand description
Sole deterministic mutation owner for one exact connection epoch.
Implementations§
Source§impl<F: WriteFrame> ConnectionCore<F>
impl<F: WriteFrame> ConnectionCore<F>
Sourcepub fn new(
endpoint: EndpointId,
lane: LaneId,
connection: ConnectionId,
epoch: ConnectionEpoch,
limits: ConnectionLimits,
) -> Self
pub fn new( endpoint: EndpointId, lane: LaneId, connection: ConnectionId, epoch: ConnectionEpoch, limits: ConnectionLimits, ) -> Self
Creates a live fixed-epoch owner with session-only admission.
Sourcepub fn with_identity_seeds(
endpoint: EndpointId,
lane: LaneId,
connection: ConnectionId,
epoch: ConnectionEpoch,
limits: ConnectionLimits,
seeds: IdentitySeeds,
) -> Self
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.
Sourcepub fn reserve(
&mut self,
now: Moment,
options: OperationOptions,
) -> Result<OperationPermit, ReserveError>
pub fn reserve( &mut self, now: Moment, options: OperationOptions, ) -> Result<OperationPermit, ReserveError>
Atomically reserves all operation resources before frame preparation.
Sourcepub fn commit(
&mut self,
permit: OperationPermit,
frame: F,
) -> Result<(OperationId, ConnectionTransition), FrameCommitError<F>>
pub fn commit( &mut self, permit: OperationPermit, frame: F, ) -> Result<(OperationId, ConnectionTransition), FrameCommitError<F>>
Atomically transfers an affine permit and exact complete frame.
Sourcepub fn front_write(
&self,
maximum: NonZeroUsize,
) -> Result<Option<WriteSlice<'_>>, ConnectionCoreError>
pub fn front_write( &self, maximum: NonZeroUsize, ) -> Result<Option<WriteSlice<'_>>, ConnectionCoreError>
Borrows at most maximum bytes from the exact FIFO write front.
Sourcepub const fn epoch(&self) -> ConnectionEpoch
pub const fn epoch(&self) -> ConnectionEpoch
Returns the exact epoch permanently owned by this aggregate.
Sourcepub fn snapshot(&self) -> ConnectionSnapshot
pub fn snapshot(&self) -> ConnectionSnapshot
Returns current deterministic policy state.
Sourcepub const fn matching(&self) -> &OrderedVerified
pub const fn matching(&self) -> &OrderedVerified
Returns immutable ordered-matching state.
Sourcepub const fn policy(&self) -> &ConnectionMachine
pub const fn policy(&self) -> &ConnectionMachine
Returns read-only access to the underlying policy state for diagnostics.
Sourcepub fn queued_write_frames(&self) -> usize
pub fn queued_write_frames(&self) -> usize
Returns complete frames still awaiting transport completion.
Sourcepub fn front_write_is_empty(&self) -> bool
pub fn front_write_is_empty(&self) -> bool
Returns whether the FIFO front can complete without transport progress.
Sourcepub fn write_effect(&self, operation: OperationId) -> Option<EffectId>
pub fn write_effect(&self, operation: OperationId) -> Option<EffectId>
Returns the internal write identity retained for an accepted operation.
Sourcepub const fn buffered_write_retained_bytes(&self) -> RetainedBytes
pub const fn buffered_write_retained_bytes(&self) -> RetainedBytes
Returns bytes retained by complete outbound frames.
Source§impl<F: WriteFrame> ConnectionCore<F>
impl<F: WriteFrame> ConnectionCore<F>
Sourcepub fn apply(
&mut self,
input: ConnectionInput,
) -> Result<ConnectionTransition, ConnectionCoreError>
pub fn apply( &mut self, input: ConnectionInput, ) -> Result<ConnectionTransition, ConnectionCoreError>
Applies one epoch-fenced command, timer, or transport observation.
Sourcepub fn apply_reply<R>(
&mut self,
reply: InboundReply<R>,
) -> Result<ConnectionTransition<R>, ConnectionCoreError>
pub fn apply_reply<R>( &mut self, reply: InboundReply<R>, ) -> Result<ConnectionTransition<R>, ConnectionCoreError>
Applies one complete opaque reply through the same aggregate owner.
Sourcepub fn advance_write(
&mut self,
epoch: ConnectionEpoch,
effect: EffectId,
written: usize,
) -> Result<ConnectionTransition, ConnectionCoreError>
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>
impl<F: WriteFrame> ConnectionCore<F>
Sourcepub fn recover(&mut self) -> ConnectionRecovery<F>
pub fn recover(&mut self) -> ConnectionRecovery<F>
Extracts every nonterminal operation and makes this aggregate unusable.