Skip to main content

IngressEvent

Enum IngressEvent 

Source
pub enum IngressEvent {
    EnvelopeFrom {
        src_peer: PeerId,
        envelope: WireEnvelope,
        src_observed_address: Option<Address>,
    },
    AppEvent {
        module_name: String,
        input_name: String,
        value_bytes: Vec<u8>,
    },
    TimerMatured {
        at_ns: u64,
    },
    Invoke {
        module_name: String,
        inputs: Vec<(String, Vec<u8>)>,
        exec_id: ExecId,
    },
    Completion {
        cmd_id: CommandId,
        results: Vec<Vec<u8>>,
    },
    CompletionFailed {
        cmd_id: CommandId,
        detail: String,
    },
    SendFailed {
        wire_req_id: u64,
        peer: Vec<u8>,
        reason: &'static str,
    },
    AppIngressError {
        source: AppIngressSource,
        byte_count: usize,
        kind: AppIngressErrorKind,
    },
}
Expand description

External-event variants pushed to the ingress queue per docs/ENGINE.md §6 entry points.

Variants§

§

EnvelopeFrom

Inbound wire envelope from the transport layer, attributed to a source peer. The engine calls PeerGovernor::check_inbound(src_peer) on ingress; blocked or non-allowlisted peers are dropped before any slot is written, surfacing as EngineStep::PeerBlocked.

Fields

§src_peer: PeerId

Peer the envelope arrived from.

§envelope: WireEnvelope

The envelope payload.

§src_observed_address: Option<Address>

Transport-observed source address, when the adapter can supply it (e.g. NAT-translated remote endpoint, dialer’s observed multiaddr). The receiver merges this into its AddressBook entry for src_peer so reflexive-address discovery composes with the sender-claimed envelope.src_peer_addresses list. None means the transport didn’t surface an observed address.

§

AppEvent

Host pushed an app event onto a Module input.

Fields

§module_name: String

Target Module’s name.

§input_name: String

Module input port name.

§value_bytes: Vec<u8>

Encoded value payload.

§

TimerMatured

External timer maturity signal (used when an off-thread scheduler drives the engine).

Fields

§at_ns: u64

Maturity timestamp (nanoseconds).

§

Invoke

Explicit Module invocation from host.

Fields

§module_name: String

Target Module’s name.

§inputs: Vec<(String, Vec<u8>)>

(input_name, value_bytes) pairs.

§exec_id: ExecId

ExecId allocated by Node::invoke so the host can correlate EngineStep::AppEvent / OpCompleted / AsyncSuspended outputs back to the originating call.

§

Completion

External (off-thread) async completion landing back at the engine.

Fields

§cmd_id: CommandId

The CommandId being fulfilled.

§results: Vec<Vec<u8>>

Encoded output payloads.

§

CompletionFailed

Async completion FAILURE landing back at the engine. Distinct from Completion: CompletionSink::fail mints this variant directly so handle_completion_failed can route to the typed OpFailed surface — the host sees a real error, not a success-bytes masquerade.

Fields

§cmd_id: CommandId

The CommandId whose await failed.

§detail: String

Human-readable failure detail; the runtime wraps it into bus::OpError on the engine side.

§

SendFailed

Transport-side send-outcome failure surfaced by an adapter (libp2p, sim, etc.) when the network NAKed an outbound envelope or its delivery deadline elapsed without an ACK. Distinct from CompletionFailed (which covers off-thread compute completion); this variant covers transport-layer delivery failure.

Fields

§wire_req_id: u64

The wire request id of the failed outbound envelope.

§peer: Vec<u8>

The destination peer that NAKed or timed out (raw multihash bytes so the engine can reconstruct PeerId::from_bytes(&peer)).

§reason: &'static str

Stable diagnostic label (e.g. "nak", "timeout", "network_unreachable"). Adapters pick from a fixed vocabulary so consumers can match on the label.

§

AppIngressError

Off-thread application-ingress failure (currently only CompletionSink::complete exceeding the per-completion result cap). The engine drains this variant and publishes a matching InfraEvent::AppIngressError on the bus so subscribers see the rejection. The synchronous Node::deliver_event / Node::invoke path publishes directly with &mut bus access; this variant is the cross-thread bridge for sinks that don’t hold a bus reference. The Component observes an async-op timeout in place of the dropped completion.

Fields

§source: AppIngressSource

Which application-side entry point raised the failure.

§byte_count: usize

Bytes the boundary was asked to admit.

§kind: AppIngressErrorKind

Which failure mode fired.

Implementations§

Source§

impl IngressEvent

Source

pub fn from_in_process(src_peer: PeerId, envelope: WireEnvelope) -> Self

Construct an EnvelopeFrom for the in-process router common case where the transport carries no NAT and the observed address is the sender’s PeerId-tagged multiaddr. Test buses and the in-process router call this so observed-address propagation exercises the same merge path as a real transport’s reflexive surface.

Trait Implementations§

Source§

impl Debug for IngressEvent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedComponent for T
where T: Any + Send + Sync,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more