pub trait PartnerAdapter: Send + Sync {
// Required method
fn receive<'a>(
&'a self,
lane_key: &'a str,
source_uri: &'a str,
deadline: Duration,
) -> BoxFuture<'a, Result<IncomingMessage, ReceiveError>>;
// Provided methods
fn send<'a>(
&'a self,
lane_key: &'a str,
target_uri: &'a str,
msg: OutgoingMessage,
) -> BoxFuture<'a, Result<Option<Exchange>, TransportError>> { ... }
fn bound_authority(&self) -> Option<String> { ... }
fn set_secret_query_keys(&self, keys: &[String]) { ... }
}Expand description
The harness-owned far side of the wire for one endpoint family.
Implementations must be Send + Sync; calls return boxed futures
so the trait stays object-safe behind Box<dyn PartnerAdapter>.
The two-key contract splits the lane from the wire: lane_key is
the registered router key whose lane (queue, parked roundtrip) the
call belongs to, target_uri/source_uri is the resolved address
the scenario referenced. Adapters that own a listener (the http
partner) read their arrival lane by the registered key’s request
path; adapters that dial treat the target URI as the wire address.
Required Methods§
Sourcefn receive<'a>(
&'a self,
lane_key: &'a str,
source_uri: &'a str,
deadline: Duration,
) -> BoxFuture<'a, Result<IncomingMessage, ReceiveError>>
fn receive<'a>( &'a self, lane_key: &'a str, source_uri: &'a str, deadline: Duration, ) -> BoxFuture<'a, Result<IncomingMessage, ReceiveError>>
Receive a message from the source URI before the deadline passes. Implementations must respect the deadline; they never hang past it.
Provided Methods§
Sourcefn send<'a>(
&'a self,
lane_key: &'a str,
target_uri: &'a str,
msg: OutgoingMessage,
) -> BoxFuture<'a, Result<Option<Exchange>, TransportError>>
fn send<'a>( &'a self, lane_key: &'a str, target_uri: &'a str, msg: OutgoingMessage, ) -> BoxFuture<'a, Result<Option<Exchange>, TransportError>>
Send a message to the target URI, parking any roundtrip under
the lane key, and return the synchronous reply when the
adapter produces one: the context-stimulus direct: send
returns the routed exchange (Ok(Some(..))) so an
expectReply assertion can read it (rc-qvz6); partner and
fake adapters answer Ok(None). Adapters without a client
role keep the default (a transport failure naming the gap);
the http partner is one such adapter — the router’s own client
lane performs every http client-role send.
The host:port authority this adapter’s listener bound, when it
owns one (the http partner); None otherwise. The router uses
it to resolve declared and dynamic endpoint references to real
wire addresses.
Sourcefn set_secret_query_keys(&self, keys: &[String])
fn set_secret_query_keys(&self, keys: &[String])
Stores the query keys classified secret (ADR-0051 positive secret rule) for the adapter’s diagnostic redaction; the router fans the set out from the booted context’s component metadata. Default noop: adapters without wire-path diagnostics render nothing to redact.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".