pub struct Socket(FileDesc);
Tuple Fields§
§0: FileDesc
Implementations§
source§impl Socket
impl Socket
pub fn new(addr: &SocketAddr, ty: c_int) -> Result<Socket>
pub fn new_raw(fam: c_int, ty: c_int) -> Result<Socket>
pub fn new_pair(fam: c_int, ty: c_int) -> Result<(Socket, Socket)>
pub fn connect_timeout( &self, addr: &SocketAddr, timeout: Duration ) -> Result<()>
pub fn accept( &self, storage: *mut sockaddr, len: *mut socklen_t ) -> Result<Socket>
pub fn duplicate(&self) -> Result<Socket>
fn recv_with_flags(&self, buf: BorrowedCursor<'_>, flags: c_int) -> Result<()>
pub fn read(&self, buf: &mut [u8]) -> Result<usize>
pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
pub fn read_buf(&self, buf: BorrowedCursor<'_>) -> Result<()>
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
pub fn is_read_vectored(&self) -> bool
fn recv_from_with_flags( &self, buf: &mut [u8], flags: c_int ) -> Result<(usize, SocketAddr)>
pub fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn recv_msg(&self, msg: &mut msghdr) -> Result<usize>
pub fn peek_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn write(&self, buf: &[u8]) -> Result<usize>
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>
pub fn is_write_vectored(&self) -> bool
pub fn send_msg(&self, msg: &mut msghdr) -> Result<usize>
pub fn set_timeout(&self, dur: Option<Duration>, kind: c_int) -> Result<()>
pub fn timeout(&self, kind: c_int) -> Result<Option<Duration>>
pub fn shutdown(&self, how: Shutdown) -> Result<()>
pub fn set_linger(&self, linger: Option<Duration>) -> Result<()>
pub fn linger(&self) -> Result<Option<Duration>>
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
pub fn nodelay(&self) -> Result<bool>
pub fn set_quickack(&self, quickack: bool) -> Result<()>
pub fn quickack(&self) -> Result<bool>
pub fn set_passcred(&self, passcred: bool) -> Result<()>
pub fn passcred(&self) -> Result<bool>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
pub fn set_mark(&self, mark: u32) -> Result<()>
pub fn take_error(&self) -> Result<Option<Error>>
pub fn as_raw(&self) -> RawFd
Trait Implementations§
source§impl AsFd for Socket
impl AsFd for Socket
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnwindSafe for Socket
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