Lines Matching defs:from
410 /// Create a new `AddressFamily` from an integer value retrieved from `libc`, usually from
799 // originally present, when returning addrs from functions like
902 /// Create a UnixAddr from a raw `sockaddr_un` struct and a size. `sun_len`
1066 char::from(b).escape_default().fmt(f)?;
1108 /// Unsafe constructor from a variable length source
1110 /// Some C APIs from provide `len`, and others do not. If it's provided it
1254 /// Creates a new socket address from IPv4 octets and a port number.
1332 fn from(addr: net::SocketAddrV4) -> Self {
1355 fn from(addr: SockaddrIn) -> Self {
1357 net::Ipv4Addr::from(addr.0.sin_addr.s_addr.to_ne_bytes()),
1368 net::SocketAddrV4::from_str(s).map(SockaddrIn::from)
1387 net::Ipv6Addr::from(self.0.sin6_addr.s6_addr)
1449 fn from(addr: net::SocketAddrV6) -> Self {
1475 fn from(addr: SockaddrIn6) -> Self {
1477 net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr),
1490 net::SocketAddrV6::from_str(s).map(SockaddrIn6::from)
1567 if i32::from(ss.ss_family) == libc::AF_UNIX {
1850 fn from(s: net::SocketAddrV4) -> Self {
1853 ss.sin = SockaddrIn::from(s);
1861 fn from(s: net::SocketAddrV6) -> Self {
1864 ss.sin6 = SockaddrIn6::from(s);
1872 fn from(s: net::SocketAddr) -> Self {
1874 net::SocketAddr::V4(sa4) => Self::from(sa4),
1875 net::SocketAddr::V6(sa6) => Self::from(sa6),
2106 /// Creates a `SockAddr` struct from libc's sockaddr.
2123 match AddressFamily::from_i32(i32::from((*addr).sa_family)) {
2179 /// Conversion from nix's SockAddr type to the underlying libc sockaddr type.
2350 /// Construct a new socket address from its port ID and multicast groups
2485 /// Construct an `AF_ALG` socket from its cipher name and type.
2589 /// Construct a new `SysControlAddr` from its kernel unique identifier
2604 /// Construct a new `SysControlAddr` from its human readable name and
2924 /// Construct a `VsockAddr` from its raw fields.
3172 // Ensure that we can convert to-and-from std::net variants without change.
3200 let name = String::from("nix\0abstract\0test");
3227 let name = String::from("nix\0abstract\0test");