Trait Socket 
Source pub trait Socket:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required methods
    fn try_read(&mut self, buf: &mut dyn ReadBuf) -> Result<usize>;
    fn try_write(&mut self, buf: &[u8]) -> Result<usize>;
    fn poll_read_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>;
    fn poll_write_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>;
    fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>;
    // Provided methods
    fn poll_flush(&mut self, _cx: &mut Context<'_>) -> Poll<Result<()>> { ... }
    fn read<'a, B: ReadBuf>(&'a mut self, buf: &'a mut B) -> Read<'a, Self, B>
       where Self: Sized { ... }
    fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>
       where Self: Sized { ... }
    fn flush(&mut self) -> Flush<'_, Self>
       where Self: Sized { ... }
    fn shutdown(&mut self) -> Shutdown<'_, Self>
       where Self: Sized { ... }
}