Struct ipv4_display::Ipv4AddrDisplay
source · [−]#[repr(transparent)]pub struct Ipv4AddrDisplay(_);
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
sourceimpl Clone for Ipv4AddrDisplay
impl Clone for Ipv4AddrDisplay
sourcefn clone(&self) -> Ipv4AddrDisplay
fn clone(&self) -> Ipv4AddrDisplay
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Ipv4AddrDisplay
impl Debug for Ipv4AddrDisplay
sourceimpl Display for Ipv4AddrDisplay
impl Display for Ipv4AddrDisplay
sourceimpl From<Ipv4Addr> for Ipv4AddrDisplay
impl From<Ipv4Addr> for Ipv4AddrDisplay
impl Copy for Ipv4AddrDisplay
Auto Trait Implementations
impl RefUnwindSafe for Ipv4AddrDisplay
impl Send for Ipv4AddrDisplay
impl Sync for Ipv4AddrDisplay
impl Unpin for Ipv4AddrDisplay
impl UnwindSafe for Ipv4AddrDisplay
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more