Struct Socket
pub struct Socket(pub(in ::sys::net::connection::socket::unix) FileDesc);
Fields
0: FileDesc
Implementations
impl Socket
fn new(family: c_int, ty: c_int) -> Result<Socket>fn new_pair(fam: c_int, ty: c_int) -> Result<(Socket, Socket)>fn connect(&self, addr: &SocketAddr) -> Result<()>fn connect_timeout(&self, addr: &SocketAddr, timeout: Duration) -> Result<()>fn accept(&self, storage: *mut sockaddr, len: *mut socklen_t) -> Result<Socket>fn duplicate(&self) -> Result<Socket>fn send_with_flags(&self, buf: &[u8], flags: c_int) -> Result<usize>fn recv_with_flags(&self, buf: BorrowedCursor<'_, u8>, flags: c_int) -> Result<()>fn read(&self, buf: &mut [u8]) -> Result<usize>fn peek(&self, buf: &mut [u8]) -> Result<usize>fn read_buf(&self, buf: BorrowedCursor<'_, u8>) -> Result<()>fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>fn is_read_vectored(&self) -> boolfn recv_from_with_flags(&self, buf: &mut [u8], flags: c_int) -> Result<(usize, SocketAddr)>fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>fn recv_msg(&self, msg: &mut msghdr) -> Result<usize>fn peek_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>fn write(&self, buf: &[u8]) -> Result<usize>fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>fn is_write_vectored(&self) -> boolfn send_msg(&self, msg: &mut msghdr) -> Result<usize>fn set_timeout(&self, dur: Option<Duration>, kind: c_int) -> Result<()>fn timeout(&self, kind: c_int) -> Result<Option<Duration>>fn shutdown(&self, how: Shutdown) -> Result<()>fn set_linger(&self, linger: Option<Duration>) -> Result<()>fn linger(&self) -> Result<Option<Duration>>fn set_keepalive(&self, keepalive: bool) -> Result<()>fn keepalive(&self) -> Result<bool>fn set_nodelay(&self, nodelay: bool) -> Result<()>fn nodelay(&self) -> Result<bool>fn set_quickack(&self, quickack: bool) -> Result<()>fn quickack(&self) -> Result<bool>fn set_deferaccept(&self, accept: Duration) -> Result<()>fn deferaccept(&self) -> Result<Duration>fn set_passcred(&self, passcred: bool) -> Result<()>fn passcred(&self) -> Result<bool>fn set_nonblocking(&self, nonblocking: bool) -> Result<()>fn set_mark(&self, mark: u32) -> Result<()>fn take_error(&self) -> Result<Option<Error>>fn as_raw(&self) -> RawFd
Trait Implementations
impl AsFd for Socket
fn as_fd(&self) -> BorrowedFd<'_>
impl AsInner<FileDesc> for Socket
fn as_inner(&self) -> &FileDesc
impl AsRawFd for Socket
fn as_raw_fd(&self) -> RawFd
impl FromInner<FileDesc> for Socket
fn from_inner(file_desc: FileDesc) -> Self
impl FromRawFd for Socket
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self
impl IntoInner<FileDesc> for Socket
fn into_inner(self) -> FileDesc
impl IntoRawFd for Socket
fn into_raw_fd(self) -> RawFd
Auto Trait Implementations
impl Freeze for Socket
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnsafeUnpin for Socket
impl UnwindSafe for Socket
Blanket Implementations
impl<T> Any for Socket
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Socket
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Socket
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Socket
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Socket
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Socket
impl<T, U> Into<U> for Socket
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Socket
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Socket
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>