pub trait HasPeer<Peer: Role>: Role {
// Required method
fn remote_style(&self, peer: Peer) -> RemoteStyle;
}Expand description
Declares that a role can send messages to a specific peer.
Most roles only communicate with their counterpart, but some (like acp::Proxy)
can communicate with multiple peers:
Proxy: HasPeer<Client>- proxy can send/receive from clientsProxy: HasPeer<Agent>- proxy can send/receive from agentsProxy: HasPeer<Conductor>- proxy can send/receive from its conductor
The RemoteStyle determines how messages are transformed:
RemoteStyle::Counterpart- pass through unchangedRemoteStyle::Predecessor- pass through, but reject wrapped messagesRemoteStyle::Successor- wrap in aSuccessorMessageenvelope
Required Methods§
Sourcefn remote_style(&self, peer: Peer) -> RemoteStyle
fn remote_style(&self, peer: Peer) -> RemoteStyle
Returns the remote style for sending to this peer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".