Skip to main content

ParticipantSemanticHandler

Trait ParticipantSemanticHandler 

Source
pub trait ParticipantSemanticHandler:
    Debug
    + Send
    + Sync {
Show 15 methods // Required method fn handle( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ClientRequest, ) -> Result<ServerValue, ParticipantSemanticError>; // Provided methods fn service_fatal( &self, ) -> Result<Option<ParticipantServiceFatal>, ParticipantSemanticError> { ... } fn latch_connection_fate_intent_incomplete( &self, open_sequence: u64, conversation_id: ConversationId, ) -> Result<ParticipantServiceFatal, ParticipantSemanticError> { ... } fn handle_connection_fate( &self, work_item: ConnectionFateWorkItem, ) -> Result<(), ParticipantSemanticError> { ... } fn handle_connection_fate_with_impact( &self, work_item: ConnectionFateWorkItem, ) -> ParticipantConnectionFateOutcome { ... } fn repair_unclean_server_restart( &self, current_server_incarnation: u64, ) -> Result<(), ParticipantSemanticError> { ... } fn connection_has_bound_participant( &self, connection_incarnation: ConnectionIncarnation, conversations: &[ConversationId], ) -> Result<bool, ParticipantSemanticError> { ... } fn publication_conversation_limit(&self) -> u64 { ... } fn ready_connection_incarnations( &self, _conversation_id: ConversationId, ) -> Result<Vec<ConnectionIncarnation>, ParticipantSemanticError> { ... } fn next_publication( &self, _connection_incarnation: ConnectionIncarnation, _conversation_id: ConversationId, _offered: Option<ParticipantOfferedProgress>, ) -> Result<Option<ParticipantPublication>, ParticipantSemanticError> { ... } fn publication_binding_is_current( &self, _conversation_id: ConversationId, _participant_id: ParticipantId, _binding_epoch: BindingEpoch, ) -> Result<bool, ParticipantSemanticError> { ... } fn publication_is_current( &self, publication: &ParticipantPublication, offered: Option<ParticipantOfferedProgress>, ) -> Result<bool, ParticipantSemanticError> { ... } fn record_publication_offer( &self, _publication: &ParticipantPublication, ) -> Result<(), ParticipantSemanticError> { ... } fn handle_observer_recovery( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ObserverRecoveryHandshake, target: Option<ObserverPublicationTarget>, ) -> Result<ServerValue, ParticipantSemanticError> { ... } fn handle_with_impact( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ClientRequest, ) -> ParticipantSemanticOutcome<ServerValue> { ... }
}
Expand description

Server-owned adapter from a decoded request to a protocol-owned value.

Required Methods§

Source

fn handle( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ClientRequest, ) -> Result<ServerValue, ParticipantSemanticError>

Applies one decoded participant request to protocol-owned authority.

§Errors

Returns ParticipantSemanticError when durable or protocol authority cannot produce a truthful terminal value. The connection fails rather than fabricating a response.

Provided Methods§

Source

fn service_fatal( &self, ) -> Result<Option<ParticipantServiceFatal>, ParticipantSemanticError>

Applies one already authenticated and capability-gated request.

conversations is the receiving connection’s semantic-conversation dispatch map: the handler reads it for the crate’s stage-6 connection-conversation capacity facts and installs a slot exactly when an operation’s capacity commit reports newly_tracked.

§Errors

Returns ParticipantSemanticError when no protocol value can be produced. The caller closes rather than fabricating a response.

Production handlers override this with the signed max_semantic_conversations_per_connection; semantic-only fixtures own no publication conversations.

Returns the latched fatal, when participant service must remain stopped.

Source

fn latch_connection_fate_intent_incomplete( &self, open_sequence: u64, conversation_id: ConversationId, ) -> Result<ParticipantServiceFatal, ParticipantSemanticError>

Atomically latches the post-Open fatal selected by Decision B.

Implementations must preserve the first fatal and return it on every later call. The default exists only for semantic fixtures which own no durable intents.

§Errors

Returns a semantic service error when the fatal latch cannot be inspected or updated.

Source

fn handle_connection_fate( &self, work_item: ConnectionFateWorkItem, ) -> Result<(), ParticipantSemanticError>

Applies every matching participant binding named by one durable Open.

The incarnation-stream lock is not held while this method runs. Each implementation serializes conversations independently and must return only after every source and immediately executable specific fate flushes.

§Errors

Returns a semantic failure without consuming the Open; startup or the live fatal path retains it for exact replay.

Source

fn handle_connection_fate_with_impact( &self, work_item: ConnectionFateWorkItem, ) -> ParticipantConnectionFateOutcome

Applies connection fate while preserving every committed conversation’s post-flush dispatch effects on both success and failure exits.

Source

fn repair_unclean_server_restart( &self, current_server_incarnation: u64, ) -> Result<(), ParticipantSemanticError>

Repairs every remaining binding owned by a prior server incarnation.

Startup calls this after all retained Opens complete and before publishing the incarnation authority, scheduler, listener, or new admission.

§Errors

Returns a semantic failure while startup still owns all publication seams.

Source

fn connection_has_bound_participant( &self, connection_incarnation: ConnectionIncarnation, conversations: &[ConversationId], ) -> Result<bool, ParticipantSemanticError>

Reports whether any listed conversation currently contains a Bound slot owned by this exact connection. Terminal decode funnels use this query to distinguish bound-only ProtocolError from pre-auth/detached/internal paths.

§Errors

Returns a semantic failure when exact bound authority cannot be inspected.

Source

fn publication_conversation_limit(&self) -> u64

Source

fn ready_connection_incarnations( &self, _conversation_id: ConversationId, ) -> Result<Vec<ConnectionIncarnation>, ParticipantSemanticError>

Resolves all live current bindings with pending durable obligations for one conversation. Production overrides this; semantic-only fixtures have no publication source.

§Errors

Returns a semantic fault when durable readiness cannot be resolved.

Source

fn next_publication( &self, _connection_incarnation: ConnectionIncarnation, _conversation_id: ConversationId, _offered: Option<ParticipantOfferedProgress>, ) -> Result<Option<ParticipantPublication>, ParticipantSemanticError>

Selects the least durable recipient obligation for this incarnation, restarting from durable ack when offered names an older binding.

§Errors

Returns a semantic fault when the durable obligation owner is unavailable.

Source

fn publication_binding_is_current( &self, _conversation_id: ConversationId, _participant_id: ParticipantId, _binding_epoch: BindingEpoch, ) -> Result<bool, ParticipantSemanticError>

Checks that a held head still belongs to the exact current binding before it is offered after writable readiness.

§Errors

Returns a semantic fault when current binding authority cannot be read.

Source

fn publication_is_current( &self, publication: &ParticipantPublication, offered: Option<ParticipantOfferedProgress>, ) -> Result<bool, ParticipantSemanticError>

Re-selects a held publication against current binding, cursor, debt, and outbox authority before its first offer. Semantic-only handlers retain the binding-only default; production overrides this with the full locked dispatch decision.

§Errors

Returns a semantic fault when current publication authority cannot be read.

Source

fn record_publication_offer( &self, _publication: &ParticipantPublication, ) -> Result<(), ParticipantSemanticError>

Records exact successful marker enqueue testimony. Non-marker offers are ignored by production after validating their current binding.

§Errors

Returns a semantic fault when exact offer testimony cannot be recorded.

Source

fn handle_observer_recovery( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ObserverRecoveryHandshake, target: Option<ObserverPublicationTarget>, ) -> Result<ServerValue, ParticipantSemanticError>

Applies observer recovery with the weak exact-live-connection target captured by the installed service. Semantic-only handlers delegate to their ordinary request path and do not own observer publication.

§Errors

Returns ParticipantSemanticError under the same contract as Self::handle.

Source

fn handle_with_impact( &self, context: ParticipantConnectionContext, conversations: &mut ParticipantConnectionConversations, request: ClientRequest, ) -> ParticipantSemanticOutcome<ServerValue>

Applies one request and preserves post-commit effects on every exit.

Semantic-only fixtures default to an empty accumulator. Production overrides this boundary and returns operation-owned effects.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§