Skip to main content

ProtocolRuntime

Trait ProtocolRuntime 

Source
pub trait ProtocolRuntime: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn atomic_opset(&self) -> AtomicOpsetDecl;
    fn dispatch_atomic(
        &mut self,
        op_type: &str,
        inputs: &[(&str, &dyn SlotValue)],
        ctx: &mut RuntimeResourceRef<'_>,
    ) -> Result<DispatchResult, Self::Error>;
}
Expand description

Role trait for protocol implementations.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Protocol-impl-specific error type.

Required Methods§

Source

fn atomic_opset(&self) -> AtomicOpsetDecl

Atomic-op opset this protocol declares. Both inbound envelope routing AND user-graph DSL ops register here.

Source

fn dispatch_atomic( &mut self, op_type: &str, inputs: &[(&str, &dyn SlotValue)], ctx: &mut RuntimeResourceRef<'_>, ) -> Result<DispatchResult, Self::Error>

Single dispatch entry. For inbound envelopes the framework synthesizes inputs from the wire envelope:

  • peer_id: Opaque<PeerId>
  • payload: Opaque<Bytes> (raw envelope bytes)
  • correlation: Opaque<WireCorrelation>

For user-graph DSL ops the inputs come from upstream slot values exactly like any role op.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§