pub trait SocketExt {
// Required methods
fn protocol(&self) -> Protocol;
fn local_endpoint(&self) -> SocketEndpoint;
fn remote_endpoint(&self) -> SocketEndpoint;
fn is_closed(&self) -> bool;
fn close(&mut self);
fn can_recv(&self) -> bool;
fn recv(&mut self) -> Result<Option<(IpEndpoint, Vec<u8>)>, RecvError>;
fn can_send(&self) -> bool;
fn send_capacity(&self) -> usize;
fn send_queue(&self) -> usize;
fn state<T: Default>(&self) -> SocketState<T>;
fn desc(&self) -> SocketDesc;
}Expand description
Common interface for various socket types
Required Methods§
fn protocol(&self) -> Protocol
fn local_endpoint(&self) -> SocketEndpoint
fn remote_endpoint(&self) -> SocketEndpoint
fn is_closed(&self) -> bool
fn close(&mut self)
fn can_recv(&self) -> bool
fn recv(&mut self) -> Result<Option<(IpEndpoint, Vec<u8>)>, RecvError>
fn can_send(&self) -> bool
fn send_capacity(&self) -> usize
fn send_queue(&self) -> usize
fn state<T: Default>(&self) -> SocketState<T>
fn desc(&self) -> SocketDesc
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.