pub trait ControlSender: Send + Sync {
// Required methods
fn send_direct<'life0, 'async_trait>(
&'life0 self,
peer: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_routed<'life0, 'async_trait>(
&'life0 self,
dst_id: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Send a ControlFrame toward a peer, either over a direct
connected session or via the multi-hop routing table.
Required Methods§
Sourcefn send_direct<'life0, 'async_trait>(
&'life0 self,
peer: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_direct<'life0, 'async_trait>(
&'life0 self,
peer: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send to a directly-connected peer. Best-effort; failures are logged by the underlying transport.
Sourcefn send_routed<'life0, 'async_trait>(
&'life0 self,
dst_id: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_routed<'life0, 'async_trait>(
&'life0 self,
dst_id: NodeId,
frame: ControlFrame,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send via the routing table. Returns true when the next-hop
send was attempted; false when no route exists.