pub enum Socket {
Udp(Mutex<UdpSocket>),
Tcp(Mutex<TcpSocket>),
}
Variants§
Implementations§
Source§impl Socket
impl Socket
pub fn recv(&self, buf: &mut [u8]) -> LinuxResult<usize>
pub fn sendto(&self, buf: &[u8], addr: SocketAddr) -> LinuxResult<usize>
pub fn recvfrom( &self, buf: &mut [u8], ) -> LinuxResult<(usize, Option<SocketAddr>)>
pub fn listen(&self) -> LinuxResult
pub fn accept(&self) -> LinuxResult<TcpSocket>
pub fn send(&self, buf: &[u8]) -> LinuxResult<usize>
pub fn poll(&self) -> LinuxResult<PollState>
pub fn local_addr(&self) -> LinuxResult<SocketAddr>
pub fn peer_addr(&self) -> LinuxResult<SocketAddr>
pub fn bind(&self, addr: SocketAddr) -> LinuxResult
pub fn connect(&self, addr: SocketAddr) -> LinuxResult
pub fn shutdown(&self) -> LinuxResult
Trait Implementations§
Source§impl FileLike for Socket
impl FileLike for Socket
fn read(&self, buf: &mut [u8]) -> LinuxResult<usize>
fn write(&self, buf: &[u8]) -> LinuxResult<usize>
fn stat(&self) -> LinuxResult<Kstat>
fn into_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>
fn poll(&self) -> LinuxResult<PollState>
fn set_nonblocking(&self, nonblock: bool) -> LinuxResult
fn from_fd(fd: c_int) -> LinuxResult<Arc<Self>>where
Self: Sized + 'static,
fn add_to_fd_table(self) -> LinuxResult<c_int>where
Self: Sized + 'static,
Auto Trait Implementations§
impl !Freeze for Socket
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