pub trait StreamFactory {
type Stream;
// Required method
fn create(&mut self) -> Result<Self::Stream, ServerError>;
}Expand description
Trait for creating streams, used by the stream pool to generate streams as needed.
Required Associated Types§
Required Methods§
Sourcefn create(&mut self) -> Result<Self::Stream, ServerError>
fn create(&mut self) -> Result<Self::Stream, ServerError>
Creates a new stream instance.
§Errors
Returns a ServerError when the backend cannot create a stream, e.g. on a device that
is poisoned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".