pub trait SendStream: Send {
// Required methods
fn send_bytes(
&mut self,
bytes: Bytes,
) -> impl Future<Output = Result<()>> + Send;
fn send<const L: usize>(
&mut self,
buf: &[u8; L],
) -> impl Future<Output = Result<()>> + Send;
fn sync(&mut self) -> impl Future<Output = Result<()>> + Send;
fn reset(&mut self, code: VarInt) -> Result<()>;
fn stopped(&mut self) -> impl Future<Output = Result<Option<VarInt>>> + Send;
}
Expand description
An abstract iroh::endpoint::SendStream
.
Required Methods§
Sourcefn send_bytes(
&mut self,
bytes: Bytes,
) -> impl Future<Output = Result<()>> + Send
fn send_bytes( &mut self, bytes: Bytes, ) -> impl Future<Output = Result<()>> + Send
Send bytes to the stream. This takes a Bytes
because iroh can directly use them.
Sourcefn send<const L: usize>(
&mut self,
buf: &[u8; L],
) -> impl Future<Output = Result<()>> + Send
fn send<const L: usize>( &mut self, buf: &[u8; L], ) -> impl Future<Output = Result<()>> + Send
Send that sends a fixed sized buffer.
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.