Trait SocketService
pub trait SocketService<State>:
Send
+ Sync
+ 'static {
type Socket: Send + 'static;
type Error: Into<Box<dyn Error + Send + Sync>> + Send + 'static;
// Required method
fn bind(
&self,
ctx: Context<State>,
interface: impl Into<Interface>,
) -> impl Future<Output = Result<(Self::Socket, Context<State>), Self::Error>> + Send;
}
Expand description
Glue trait that is used as the trait bound for code creating/preparing a socket on one layer or another.
Can also be manually implemented as an alternative Service
trait,
but from a Rama POV it is mostly used for UX trait bounds.
Required Associated Types§
type Socket: Send + 'static
type Socket: Send + 'static
Socket returned by the SocketService
Required Methods§
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.