Trait sqlx_core::net::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 { ... }
}

Required Methods§

source

fn try_read(&mut self, buf: &mut dyn ReadBuf) -> Result<usize>

source

fn try_write(&mut self, buf: &[u8]) -> Result<usize>

source

fn poll_read_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn poll_write_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

Provided Methods§

source

fn poll_flush(&mut self, _cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn read<'a, B: ReadBuf>(&'a mut self, buf: &'a mut B) -> Read<'a, Self, B>
where Self: Sized,

source

fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>
where Self: Sized,

source

fn flush(&mut self) -> Flush<'_, Self>
where Self: Sized,

source

fn shutdown(&mut self) -> Shutdown<'_, Self>
where Self: Sized,

Implementations on Foreign Types§

source§

impl<S: Socket + ?Sized> Socket for Box<S>

source§

fn try_read(&mut self, buf: &mut dyn ReadBuf) -> Result<usize>

source§

fn try_write(&mut self, buf: &[u8]) -> Result<usize>

source§

fn poll_read_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source§

fn poll_write_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source§

fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source§

fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

Implementors§