pub trait AnySocket<'a> {
// Required methods
fn upcast(self) -> Socket<'a>;
fn downcast<'c>(socket: &'c Socket<'a>) -> Option<&'c Self>
where Self: Sized;
fn downcast_mut<'c>(socket: &'c mut Socket<'a>) -> Option<&'c mut Self>
where Self: Sized;
}Expand description
A conversion trait for network sockets.
Required Methods§
fn upcast(self) -> Socket<'a>
fn downcast<'c>(socket: &'c Socket<'a>) -> Option<&'c Self>where
Self: Sized,
fn downcast_mut<'c>(socket: &'c mut Socket<'a>) -> Option<&'c mut Self>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".