pub struct StreamSocket<P> { /* private fields */ }
Expand description
Provides a stream-oriented socket.
Implementations§
Source§impl<P: Protocol> StreamSocket<P>
impl<P: Protocol> StreamSocket<P>
pub fn new(ctx: &IoContext, pro: P) -> Result<StreamSocket<P>>
pub fn async_connect<F>(&self, ep: &P::Endpoint, handler: F) -> F::Output
pub fn async_receive<F>( &self, buf: &mut [u8], flags: i32, handler: F, ) -> F::Output
pub fn async_send<F>(&self, buf: &[u8], flags: i32, handler: F) -> F::Output
pub fn available(&self) -> Result<usize>
pub fn bind(&self, ep: &P::Endpoint) -> Result<()>
pub fn cancel(&self)
pub fn connect(&self, ep: &P::Endpoint) -> Result<()>
pub fn get_non_blocking(&self) -> Result<bool>
pub fn get_option<C>(&self) -> Result<C>where
C: GetSocketOption<P>,
pub fn io_control<C>(&self, cmd: &mut C) -> Result<()>where
C: IoControl,
pub fn local_endpoint(&self) -> Result<P::Endpoint>
pub fn receive(&self, buf: &mut [u8], flags: i32) -> Result<usize>
pub fn remote_endpoint(&self) -> Result<P::Endpoint>
pub fn send(&self, buf: &[u8], flags: i32) -> Result<usize>
pub fn set_non_blocking(&self, on: bool) -> Result<()>
pub fn set_option<C>(&self, cmd: C) -> Result<()>where
C: SetSocketOption<P>,
pub fn shutdown(&self, how: Shutdown) -> Result<()>
Trait Implementations§
Source§impl<P> AsIoContext for StreamSocket<P>
impl<P> AsIoContext for StreamSocket<P>
Source§impl<P> AsRawFd for StreamSocket<P>
impl<P> AsRawFd for StreamSocket<P>
Source§impl<P: Protocol> Debug for StreamSocket<P>
impl<P: Protocol> Debug for StreamSocket<P>
Source§impl<P: Protocol> Socket<P> for StreamSocket<P>
impl<P: Protocol> Socket<P> for StreamSocket<P>
unsafe fn from_raw_fd(ctx: &IoContext, pro: P, fd: RawFd) -> StreamSocket<P>
fn protocol(&self) -> P
Source§impl<P: Protocol> Stream<Error> for StreamSocket<P>
impl<P: Protocol> Stream<Error> for StreamSocket<P>
impl<P> Send for StreamSocket<P>
Auto Trait Implementations§
impl<P> Freeze for StreamSocket<P>where
P: Freeze,
impl<P> !RefUnwindSafe for StreamSocket<P>
impl<P> !Sync for StreamSocket<P>
impl<P> Unpin for StreamSocket<P>where
P: Unpin,
impl<P> !UnwindSafe for StreamSocket<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more