pub trait RequestForwarder: Send + Sync {
// Required method
fn forward<'life0, 'async_trait>(
&'life0 self,
target: SocketAddr,
metadata: MetadataMap,
request: ForwardRequest,
) -> Pin<Box<dyn Future<Output = Result<ForwardReply, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Relays a client request to a remote shard owner and returns its reply.
The transport is abstracted (Decision C): gRPC now, liminal later, behind one
trait. Errors are returned as a tonic Status so the edge can relay them
verbatim (an owner NotOwner stays NotOwner; a transport failure surfaces
as Unavailable).
Required Methods§
Sourcefn forward<'life0, 'async_trait>(
&'life0 self,
target: SocketAddr,
metadata: MetadataMap,
request: ForwardRequest,
) -> Pin<Box<dyn Future<Output = Result<ForwardReply, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn forward<'life0, 'async_trait>(
&'life0 self,
target: SocketAddr,
metadata: MetadataMap,
request: ForwardRequest,
) -> Pin<Box<dyn Future<Output = Result<ForwardReply, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Forward request to target (the owner’s gRPC address), copying the
caller metadata and stamping the next hop count, then relay the reply.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".