Lines Matching defs:Ipv4Addr
41 /// Convert a std::net::Ipv4Addr into the libc form.
43 pub(crate) const fn ipv4addr_to_libc(addr: net::Ipv4Addr) -> libc::in_addr {
44 static_assertions::assert_eq_size!(net::Ipv4Addr, libc::in_addr);
472 sin_addr: Ipv4Addr::from_std(addr.ip()).0,
518 InetAddr::V4(ref sa) => IpAddr::V4(Ipv4Addr(sa.sin_addr)),
535 Ipv4Addr(sa.sin_addr).to_std(),
575 V4(Ipv4Addr),
586 IpAddr::V4(Ipv4Addr::new(a, b, c, d))
600 net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)),
625 * ===== Ipv4Addr =====
631 note = "Use std::net::Ipv4Addr instead"
636 pub struct Ipv4Addr(pub libc::in_addr);
640 impl Ipv4Addr {
642 pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
648 Ipv4Addr(libc::in_addr { s_addr: ip })
653 pub fn from_std(std: &net::Ipv4Addr) -> Ipv4Addr {
655 Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3])
658 pub const fn any() -> Ipv4Addr {
659 Ipv4Addr(libc::in_addr { s_addr: libc::INADDR_ANY })
667 pub const fn to_std(self) -> net::Ipv4Addr {
669 net::Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3])
674 impl fmt::Display for Ipv4Addr {
1357 net::Ipv4Addr::from(addr.0.sin_addr.s_addr.to_ne_bytes()),
2967 let s = std::net::Ipv4Addr::new(1, 2, 3, 4);