Lines Matching defs:new

410     /// Create a new `AddressFamily` from an integer value retrieved from `libc`, usually from
495 pub fn new(ip: IpAddr, port: u16) -> InetAddr {
534 net::SocketAddrV4::new(
538 net::SocketAddrV6::new(
582 /// Create a new IpAddr that contains an IPv4 address.
586 IpAddr::V4(Ipv4Addr::new(a, b, c, d))
589 /// Create a new IpAddr that contains an IPv6 address.
595 IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h))
642 pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
655 Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3])
669 net::Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3])
717 pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr {
723 Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7])
733 net::Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7])
803 Self::Pathname(Path::new(OsStr::from_bytes(
807 Self::Pathname(Path::new(OsStr::from_bytes(pathname)))
813 /// Create a new sockaddr_un representing a filesystem path.
814 pub fn new<P: ?Sized + NixPath>(path: &P) -> Result<UnixAddr> {
853 /// Create a new `sockaddr_un` representing an address in the "abstract namespace".
888 /// Create a new `sockaddr_un` representing an "unnamed" unix socket address.
1254 /// Creates a new socket address from IPv4 octets and a port number.
1255 pub fn new(a: u8, b: u8, c: u8, d: u8, port: u16) -> Self {
1356 net::SocketAddrV4::new(
1437 let std = net::SocketAddrV6::new(
1476 net::SocketAddrV6::new(
2037 Ok(SockAddr::Unix(UnixAddr::new(path)?))
2043 SockAddr::Netlink(NetlinkAddr::new(pid, groups))
2049 SockAddr::Alg(AlgAddr::new(alg_type, alg_name))
2063 SockAddr::Vsock(VsockAddr::new(cid, port))
2350 /// Construct a new socket address from its port ID and multicast groups
2352 pub fn new(pid: u32, groups: u32) -> NetlinkAddr {
2486 pub fn new(alg_type: &str, alg_name: &str) -> AlgAddr {
2589 /// Construct a new `SysControlAddr` from its kernel unique identifier
2591 pub const fn new(id: u32, unit: u32) -> SysControlAddr {
2604 /// Construct a new `SysControlAddr` from its human readable name and
2617 Ok(SysControlAddr::new(info.ctl_id, unit))
2925 pub fn new(cid: u32, port: u32) -> VsockAddr {
2967 let s = std::net::Ipv4Addr::new(1, 2, 3, 4);
2974 let s = std::net::Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8);
3189 let ua = UnixAddr::new("/var/run/mysock").unwrap();