pub struct Channel {
pub name: String,
pub from: ChannelFrom,
pub lifetime: ChannelLifetime,
pub backend: ChannelBackend,
pub channel_id: Option<u64>,
pub envelope: Option<String>,
pub requests: Vec<Request>,
pub events: Vec<Event>,
}Expand description
A communication channel — the unit of request/response and event traffic.
Fields§
§name: StringChannel name (e.g. "ping-pong").
from: ChannelFromWhich peer opens the channel.
lifetime: ChannelLifetimeHow long the channel lives.
backend: ChannelBackendWire backend. Defaults to ChannelBackend::Stream.
channel_id: Option<u64>Demux identifier, required when Self::backend is
ChannelBackend::Datagram. A positive integer (1..).
envelope: Option<String>When Some(tag), the emitters generate a discriminated-union
envelope type bundling every Self::requests entry, internally
tagged by the JSON field named tag (channel "ipc" envelope="t" ⇒
Some("t")). None leaves the channel emitting per-request payloads
only — the channel output is then byte-identical to a pre-envelope
build.
requests: Vec<Request>Request/response definitions in source order. Always empty for a datagram channel (datagram channels carry events only).
events: Vec<Event>Event definitions in source order.