pub trait StreamWriter<'a> {
type Input: 'a;
type Info;
// Required methods
fn info(&self) -> &Self::Info;
fn write(
&self,
input: Self::Input,
) -> impl Future<Output = StreamResult<()>> + Send;
fn close(self) -> impl Future<Output = StreamResult<()>> + Send;
fn close_with_reason(
self,
reason: &str,
) -> impl Future<Output = StreamResult<()>> + Send;
}Expand description
Writer for an open data stream.
Required Associated Types§
Required Methods§
Sourcefn write(
&self,
input: Self::Input,
) -> impl Future<Output = StreamResult<()>> + Send
fn write( &self, input: Self::Input, ) -> impl Future<Output = StreamResult<()>> + Send
Writes to the stream.
Sourcefn close_with_reason(
self,
reason: &str,
) -> impl Future<Output = StreamResult<()>> + Send
fn close_with_reason( self, reason: &str, ) -> impl Future<Output = StreamResult<()>> + Send
Closes the stream abnormally, specifying the reason for closure.
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.