pub trait RunWithConnectionTo<Counterpart: Role>: Send {
// Required method
fn run_with_connection_to(
self,
cx: ConnectionTo<Counterpart>,
) -> impl Future<Output = Result<(), Error>> + Send;
}Expand description
A background task that runs alongside a connection.
RunIn<R> means “run in the context of being role R”. The task receives
a ConnectionTo<R::Counterpart> for communicating with the other side.
Implementations are composed using ChainRun and run in parallel
when the connection is active.
Required Methods§
Sourcefn run_with_connection_to(
self,
cx: ConnectionTo<Counterpart>,
) -> impl Future<Output = Result<(), Error>> + Send
fn run_with_connection_to( self, cx: ConnectionTo<Counterpart>, ) -> impl Future<Output = Result<(), Error>> + Send
Run this task to completion.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".