pub struct Ipv4AddrDisplay(/* private fields */);
Expand description
A wrapper around Ipv4Addr
, providing an implementation of fmt::Display
that is more performant than the one provided by the Rust standard library.
Examples:
use std::net::Ipv4Addr;
use ipv4_display::Ipv4AddrDisplay;
assert_eq!(Ipv4AddrDisplay::new(Ipv4Addr::UNSPECIFIED).to_string(), "0.0.0.0");
assert_eq!(Ipv4AddrDisplay::new(Ipv4Addr::LOCALHOST).to_string(), "127.0.0.1");
assert_eq!(Ipv4AddrDisplay::new(Ipv4Addr::new(231, 2, 30, 102)).to_string(), "231.2.30.102");
Implementations§
Trait Implementations§
Source§impl Clone for Ipv4AddrDisplay
impl Clone for Ipv4AddrDisplay
Source§fn clone(&self) -> Ipv4AddrDisplay
fn clone(&self) -> Ipv4AddrDisplay
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Ipv4AddrDisplay
impl Debug for Ipv4AddrDisplay
Source§impl Display for Ipv4AddrDisplay
impl Display for Ipv4AddrDisplay
Source§impl From<Ipv4Addr> for Ipv4AddrDisplay
impl From<Ipv4Addr> for Ipv4AddrDisplay
impl Copy for Ipv4AddrDisplay
Auto Trait Implementations§
impl Freeze for Ipv4AddrDisplay
impl RefUnwindSafe for Ipv4AddrDisplay
impl Send for Ipv4AddrDisplay
impl Sync for Ipv4AddrDisplay
impl Unpin for Ipv4AddrDisplay
impl UnwindSafe for Ipv4AddrDisplay
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