Skip to main content

Module socket

Module socket 

Source

Re-exportsยง

use crate::ffi::c_int; ๐Ÿ”’
use crate::ffi::c_void; ๐Ÿ”’
use crate::io; ๐Ÿ”’
use crate::io::BorrowedCursor; ๐Ÿ”’ Experimental
use crate::io::ErrorKind; ๐Ÿ”’
use crate::io::IoSlice; ๐Ÿ”’
use crate::io::IoSliceMut; ๐Ÿ”’
use crate::mem::MaybeUninit; ๐Ÿ”’
use crate::net::Ipv4Addr; ๐Ÿ”’
use crate::net::Ipv6Addr; ๐Ÿ”’
use crate::net::Shutdown; ๐Ÿ”’
use crate::net::SocketAddr; ๐Ÿ”’
use crate::net::SocketAddrV4; ๐Ÿ”’
use crate::net::SocketAddrV6; ๐Ÿ”’
use crate::net::ToSocketAddrs; ๐Ÿ”’
use crate::sys::helpers::run_with_cstr; ๐Ÿ”’
use crate::sys::net::connection::each_addr; ๐Ÿ”’
use crate::sys::AsInner; ๐Ÿ”’
use crate::sys::FromInner; ๐Ÿ”’
use crate::time::Duration; ๐Ÿ”’
use crate::cmp; ๐Ÿ”’
use crate::fmt; ๐Ÿ”’
use crate::mem; ๐Ÿ”’
use crate::ptr; ๐Ÿ”’
use netc as c; ๐Ÿ”’
use c::IPV6_ADD_MEMBERSHIP; ๐Ÿ”’
use c::IPV6_DROP_MEMBERSHIP; ๐Ÿ”’
use libc::MSG_NOSIGNAL; ๐Ÿ”’
pub use unix::*;

Modulesยง

unix ๐Ÿ”’

Structsยง

LookupHost
TcpListener
TcpStream
UdpSocket

Constantsยง

MAX_SEND_LEN ๐Ÿ”’
SOCK_NONBLOCK ๐Ÿ”’
Some systems support setting the nonblocking mode upon socket creation, which saves a syscall.

Functionsยง

addr_family ๐Ÿ”’
getsockoptโš 
Gets the value of a socket option.
ip_v4_addr_from_c ๐Ÿ”’
ip_v4_addr_to_c ๐Ÿ”’
ip_v6_addr_from_c ๐Ÿ”’
ip_v6_addr_to_c ๐Ÿ”’
lookup_host
setsockoptโš 
Sets the value of a socket option.
socket_addr_from_c ๐Ÿ”’ โš 
Converts the C socket address stored in storage to a Rust SocketAddr.
socket_addr_to_c ๐Ÿ”’
socket_addr_v4_from_c ๐Ÿ”’
socket_addr_v4_to_c ๐Ÿ”’
socket_addr_v6_from_c ๐Ÿ”’
socket_addr_v6_to_c ๐Ÿ”’
sockname ๐Ÿ”’ โš 
Wraps a call to a platform function that returns a socket address.
to_ipv6mr_interface ๐Ÿ”’ Non-Android

Type Aliasesยง

IpV4MultiCastType ๐Ÿ”’

Unionsยง

SocketAddrCRepr ๐Ÿ”’
A type with the same memory layout as c::sockaddr. Used in converting Rust level SocketAddr* types into their system representation. The benefit of this specific type over using c::sockaddr_storage is that this type is exactly as large as it needs to be and not a lot larger. And it can be initialized more cleanly from Rust.