pub struct CommsRuntime { /* private fields */ }Implementations§
Source§impl CommsRuntime
impl CommsRuntime
pub async fn new(config: ResolvedCommsConfig) -> Result<Self, CommsRuntimeError>
pub async fn new_with_silent_intents( config: ResolvedCommsConfig, silent_intents: Arc<HashSet<String>>, ) -> Result<Self, CommsRuntimeError>
pub fn inproc_only(name: &str) -> Result<Self, CommsRuntimeError>
pub fn inproc_only_scoped( name: &str, namespace: Option<String>, ) -> Result<Self, CommsRuntimeError>
pub fn inproc_only_with_silent_intents( name: &str, namespace: Option<String>, silent_intents: Arc<HashSet<String>>, ) -> Result<Self, CommsRuntimeError>
pub fn inproc_only_with_keypair_and_silent_intents( name: &str, namespace: Option<String>, keypair: Keypair, _silent_intents: Arc<HashSet<String>>, ) -> Result<Self, CommsRuntimeError>
pub fn set_listen_tcp_for_unstarted_runtime( &mut self, listen_tcp: SocketAddr, ) -> Result<(), CommsRuntimeError>
pub fn set_advertise_address_for_unstarted_runtime( &mut self, advertise_address: String, ) -> Result<(), CommsRuntimeError>
pub async fn inproc_only_session_scoped_with_silent_intents( name: &str, namespace: Option<String>, identity_root: PathBuf, session_id: &SessionId, _silent_intents: Arc<HashSet<String>>, session_claim_handle: Arc<dyn SessionClaimHandle>, ) -> Result<Self, CommsRuntimeError>
pub fn participant_name(&self) -> &str
Sourcepub fn set_blob_store(&mut self, blob_store: Arc<dyn BlobStore>)
pub fn set_blob_store(&mut self, blob_store: Arc<dyn BlobStore>)
Set the blob store used to resolve blob-backed image blocks before transport send. Comms stays byte-oriented; refs never cross the peer boundary.
Mark this runtime as requiring peer-comms machine authority.
Missing PeerCommsHandle already fails closed for classified ingress;
this flag remains as an observable session-mode marker for callers.
pub fn peer_comms_handle(&self) -> Option<Arc<dyn PeerCommsHandle>>
Install both machine handles required for semantic peer request/response.
This is the typed boundary between transport-only comms and semantic
request/response. Without this authority, PeerRequest and
PeerResponse sends fail closed before transport send or receipt
emission.
Sourcepub fn install_peer_interaction_handle(
self: &Arc<Self>,
handle: Arc<dyn PeerInteractionHandle>,
)
pub fn install_peer_interaction_handle( self: &Arc<Self>, handle: Arc<dyn PeerInteractionHandle>, )
Install the session’s peer-interaction DSL handle (W1-A).
Called by the surface after the session’s SessionRuntimeBindings
land. Two things happen here:
- The runtime stores the handle so outbound
PeerRequestsends firePeerInteractionHandle::request_sent(DSL authority). - The runtime registers itself as the handle’s cleanup observer,
so every DSL
PeerInteractionCleanupeffect drops the matching entries insubscriber_registry/interaction_stream_registry. That closes the “terminal transition → effect → cleanup” causal chain — the shell registries are a projection of DSL truth, not shadow state updated by lexical adjacency.
Sourcepub fn peer_interaction_handle(&self) -> Option<Arc<dyn PeerInteractionHandle>>
pub fn peer_interaction_handle(&self) -> Option<Arc<dyn PeerInteractionHandle>>
Read-side accessor for the installed peer-interaction handle.
Sourcepub fn install_interaction_stream_handle(
self: &Arc<Self>,
handle: Arc<dyn InteractionStreamHandle>,
)
pub fn install_interaction_stream_handle( self: &Arc<Self>, handle: Arc<dyn InteractionStreamHandle>, )
Install the session’s interaction-stream lifecycle DSL handle (U6).
Two things happen here:
- The runtime stores the handle so machine-authoritative reservation, attach, completion, expiry, and consumer-drop transitions flow through the DSL.
- The runtime registers itself as the handle’s cleanup observer, so
every
InteractionStreamCleanupeffect drops the matching entry ininteraction_stream_registry(and the pairedsubscriber_registryentry under the same lock).
For machine-authoritative entries, the registry holds channels only and lifecycle truth (Reserved/Attached/Completed/Expired/ClosedEarly) lives in the DSL. Local input streams stay transport-only.
Sourcepub fn interaction_stream_handle(
&self,
) -> Option<Arc<dyn InteractionStreamHandle>>
pub fn interaction_stream_handle( &self, ) -> Option<Arc<dyn InteractionStreamHandle>>
Read-side accessor for the installed interaction-stream handle.
pub fn inproc_namespace(&self) -> Option<&str>
pub fn advertised_address(&self) -> String
pub async fn start_listeners(&mut self) -> Result<(), CommsRuntimeError>
pub fn public_key(&self) -> PubKey
pub fn bridge_bootstrap_token(&self) -> &str
pub fn router(&self) -> &Router
Sourcepub fn set_outbound_content_taint(&self, taint: Option<SenderContentTaint>)
pub fn set_outbound_content_taint(&self, taint: Option<SenderContentTaint>)
Install (or clear) the host-owned outbound content-taint declaration.
Host-set config, not machine state: the declaration is stamped onto
every content-bearing envelope at the router’s single outbound choke
point unless a per-send meerkat_core::comms::SendTaintOverride
says otherwise. None clears the declaration (subsequent sends carry
no taint field).
Sourcepub fn outbound_content_taint(&self) -> Option<SenderContentTaint>
pub fn outbound_content_taint(&self) -> Option<SenderContentTaint>
The currently-installed host-owned outbound content-taint declaration.
Sourcepub fn set_peer_meta(&self, meta: PeerMeta)
pub fn set_peer_meta(&self, meta: PeerMeta)
Update the inproc registry entry with friendly metadata.
Call this after construction to advertise [PeerMeta] to other
in-process agents via InprocRegistry::peers().
Internally re-registers with [InprocRegistry::register_with_meta],
which replaces the full entry (including inbox sender). This is safe
because the sender is cloned from the same router and pending
deliveries are unaffected.
Sourcepub fn mark_interaction_complete(&self, interaction_id: Uuid)
pub fn mark_interaction_complete(&self, interaction_id: Uuid)
Mark an interaction stream as completed (terminal event received).
Machine-authoritative streams complete through the DSL is_attached
guard: if the consumer already closed the stream, the transition is
rejected and this call is a no-op. Local transport-only streams have no
semantic lifecycle twin, so completion drops their channel projection.
Sourcepub fn reap_expired_reservations(&self)
pub fn reap_expired_reservations(&self)
Reap expired reservations that were never attached within the TTL.
TTL is shell-owned mechanics (created_at lives with the channel
projection, not the DSL). Machine-authoritative reservations fire
InteractionStreamHandle::expired; local transport-only reservations
remove the unclaimed channel projection directly. If the reservation
also corresponds to a live outbound peer-request DSL entry, fires
PeerRequestTimedOut so the peer-correlation lifecycle matches reality.
pub fn router_arc(&self) -> Arc<Router> ⓘ
pub fn inbox_notify(&self) -> Arc<Notify> ⓘ
Sourcepub fn tool_material(self: &Arc<Self>) -> CommsToolMaterial
pub fn tool_material(self: &Arc<Self>) -> CommsToolMaterial
Extract the material needed for comms tool composition.
The facade uses this to compose comms tools without reaching into router/trust/key internals directly.
Sourcepub fn event_injector(&self) -> Arc<dyn EventInjector> ⓘ
pub fn event_injector(&self) -> Arc<dyn EventInjector> ⓘ
Get an event injector for this runtime’s inbox.
pub async fn drain_messages(&self) -> Vec<CommsMessage>
pub async fn recv_message(&self) -> Option<CommsMessage>
pub fn shutdown(&mut self)
pub fn abort_listeners_for_rebind(&self)
pub async fn stop_listeners_for_rebind(&self)
Trait Implementations§
Source§impl CommsRuntime for CommsRuntime
impl CommsRuntime for CommsRuntime
Source§fn set_outbound_content_taint(
&self,
taint: Option<SenderContentTaint>,
) -> Result<(), SendError>
fn set_outbound_content_taint( &self, taint: Option<SenderContentTaint>, ) -> Result<(), SendError>
Source§fn drain_messages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drain_messages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn peer_id(&self) -> Option<PeerId>
fn peer_id(&self) -> Option<PeerId>
Source§fn public_key(&self) -> Option<String>
fn public_key(&self) -> Option<String>
Source§fn public_key_bytes(&self) -> Option<[u8; 32]>
fn public_key_bytes(&self) -> Option<[u8; 32]>
Source§fn comms_name(&self) -> Option<String>
fn comms_name(&self) -> Option<String>
Source§fn advertised_address(&self) -> Option<String>
fn advertised_address(&self) -> Option<String>
Source§fn bridge_bootstrap_token(&self) -> Option<String>
fn bridge_bootstrap_token(&self) -> Option<String>
Source§fn apply_trust_mutation<'life0, 'async_trait>(
&'life0 self,
mutation: CommsTrustMutation,
) -> Pin<Box<dyn Future<Output = Result<CommsTrustMutationResult, SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_trust_mutation<'life0, 'async_trait>(
&'life0 self,
mutation: CommsTrustMutation,
) -> Pin<Box<dyn Future<Output = Result<CommsTrustMutationResult, SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn install_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn validate_recovered_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_recovered_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn install_recovered_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_recovered_generated_mob_trust_owner<'life0, 'async_trait>(
&'life0 self,
owner: Arc<dyn Any + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn event_injector(&self) -> Option<Arc<dyn EventInjector>>
fn event_injector(&self) -> Option<Arc<dyn EventInjector>>
Source§fn send<'life0, 'async_trait>(
&'life0 self,
cmd: CommsCommand,
) -> Pin<Box<dyn Future<Output = Result<SendReceipt, SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
cmd: CommsCommand,
) -> Pin<Box<dyn Future<Output = Result<SendReceipt, SendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerDirectoryEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerDirectoryEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn drain_inbox_interactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<InboxInteraction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drain_inbox_interactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<InboxInteraction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn interaction_subscriber(
&self,
id: &InteractionId,
) -> Option<Sender<AgentEvent>>
fn interaction_subscriber( &self, id: &InteractionId, ) -> Option<Sender<AgentEvent>>
Source§fn mark_interaction_complete(&self, id: &InteractionId)
fn mark_interaction_complete(&self, id: &InteractionId)
Source§fn peer_interaction_handle(&self) -> Option<Arc<dyn PeerInteractionHandle>>
fn peer_interaction_handle(&self) -> Option<Arc<dyn PeerInteractionHandle>>
Source§fn drain_classified_inbox_interactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClassifiedInboxInteraction>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drain_classified_inbox_interactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClassifiedInboxInteraction>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn peer_ingress_queue_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PeerIngressQueueSnapshot, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peer_ingress_queue_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PeerIngressQueueSnapshot, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn peer_ingress_runtime_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PeerIngressRuntimeSnapshot, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peer_ingress_runtime_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PeerIngressRuntimeSnapshot, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn public_trusted_peer_projection_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedPeerDescriptor>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn public_trusted_peer_projection_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedPeerDescriptor>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn trusted_peer_projection_snapshot_for_source<'life0, 'async_trait>(
&'life0 self,
source_kind: GeneratedCommsTrustAuthoritySourceKind,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedPeerDescriptor>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn trusted_peer_projection_snapshot_for_source<'life0, 'async_trait>(
&'life0 self,
source_kind: GeneratedCommsTrustAuthoritySourceKind,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrustedPeerDescriptor>, CommsCapabilityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn actionable_input_notify(&self) -> Result<Arc<Notify>, CommsCapabilityError>
fn actionable_input_notify(&self) -> Result<Arc<Notify>, CommsCapabilityError>
Source§fn add_private_trusted_peer<'life0, 'async_trait>(
&'life0 self,
_peer: TrustedPeerDescriptor,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_private_trusted_peer<'life0, 'async_trait>(
&'life0 self,
_peer: TrustedPeerDescriptor,
) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn remove_private_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
_peer_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SendError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn remove_private_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
_peer_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SendError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn dismiss_received(&self) -> bool
fn dismiss_received(&self) -> bool
drain_messages call.Source§fn take_interaction_stream_sender(
&self,
_id: &InteractionId,
) -> Option<Sender<AgentEvent>>
fn take_interaction_stream_sender( &self, _id: &InteractionId, ) -> Option<Sender<AgentEvent>>
Source§fn drain_peer_input_candidates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerInputCandidate>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn drain_peer_input_candidates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerInputCandidate>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§impl Drop for CommsRuntime
impl Drop for CommsRuntime
Source§impl InteractionStreamCleanupObserver for CommsRuntime
impl InteractionStreamCleanupObserver for CommsRuntime
Source§fn on_interaction_stream_cleanup(&self, corr_id: PeerCorrelationId)
fn on_interaction_stream_cleanup(&self, corr_id: PeerCorrelationId)
InteractionStreamCleanup { corr_id } effect. Read moreSource§impl PeerCommsInstallTarget for CommsRuntime
impl PeerCommsInstallTarget for CommsRuntime
fn install_generated_peer_comms_handle( &self, install: GeneratedPeerCommsInstall, ) -> Result<(), String>
fn generated_peer_comms_target_endpoint( &self, ) -> Result<TrustedPeerDescriptor, String>
Source§impl PeerInteractionCleanupObserver for CommsRuntime
impl PeerInteractionCleanupObserver for CommsRuntime
Source§fn on_peer_interaction_cleanup(&self, corr_id: PeerCorrelationId)
fn on_peer_interaction_cleanup(&self, corr_id: PeerCorrelationId)
PeerInteractionCleanup { corr_id } effect. Read more