Trait ControlChannelServer
pub trait ControlChannelServer: Send {
type Error: Error + Send + Sync + 'static;
// Required methods
fn accept(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn send(
&mut self,
frame: &[u8],
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn recv(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize, Self::Error>> + Send;
}Expand description
Server endpoint of the daemon-to-client control channel for one client connection.
The daemon owns one ControlChannelServer per connected client and
uses it to push framed messages defined in cssh-rs-protocol.
Required Associated Types§
Required Methods§
fn accept(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
fn accept(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
Wait for the client process to connect.
§Returns
Ok(()) once a client has connected, or an error if the
underlying endpoint failed.
fn send(
&mut self,
frame: &[u8],
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn send( &mut self, frame: &[u8], ) -> impl Future<Output = Result<(), Self::Error>> + Send
Send an already-framed control message to the connected client.
§Arguments
frame- Bytes produced bycssh-rs-protocolserialization helpers; the trait performs no framing of its own.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.