1.0.0[−][src]Struct validators::prelude::validators_prelude::Ipv4Addr
An IPv4 address.
IPv4 addresses are defined as 32-bit integers in IETF RFC 791. They are usually represented as four octets.
See IpAddr for a type encompassing both IPv4 and IPv6 addresses.
The size of an Ipv4Addr struct may vary depending on the target operating
system.
Textual representation
Ipv4Addr provides a FromStr implementation. The four octets are in decimal
notation, divided by . (this is called "dot-decimal notation").
Examples
use std::net::Ipv4Addr; let localhost = Ipv4Addr::new(127, 0, 0, 1); assert_eq!("127.0.0.1".parse(), Ok(localhost)); assert_eq!(localhost.is_loopback(), true);
Trait Implementations
impl Clone for Ipv4Addr[src]
impl Copy for Ipv4Addr[src]
impl Debug for Ipv4Addr[src]
impl<'de> Deserialize<'de> for Ipv4Addr[src]
fn deserialize<D>(
deserializer: D
) -> Result<Ipv4Addr, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, [src]
deserializer: D
) -> Result<Ipv4Addr, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for Ipv4Addr[src]
impl Eq for Ipv4Addr[src]
impl From<[u8; 4]> for Ipv4Addr1.9.0[src]
fn from(octets: [u8; 4]) -> Ipv4Addr[src]
Creates an Ipv4Addr from a four element byte array.
Examples
use std::net::Ipv4Addr; let addr = Ipv4Addr::from([13u8, 12u8, 11u8, 10u8]); assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);
impl From<Ipv4Addr> for IpAddr1.16.0[src]
fn from(ipv4: Ipv4Addr) -> IpAddr[src]
Copies this address to a new IpAddr::V4.
Examples
use std::net::{IpAddr, Ipv4Addr}; let addr = Ipv4Addr::new(127, 0, 0, 1); assert_eq!( IpAddr::V4(addr), IpAddr::from(addr) )
impl From<u32> for Ipv4Addr1.1.0[src]
fn from(ip: u32) -> Ipv4Addr[src]
Converts a host byte order u32 into an Ipv4Addr.
Examples
use std::net::Ipv4Addr; let addr = Ipv4Addr::from(0x0d0c0b0au32); assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);
impl<'v> FromFormValue<'v> for Ipv4Addr[src]
type Error = &'v RawStr
The associated error which can be returned from parsing. It is a good idea to have the return type be or contain an &'v str so that the unparseable string can be examined after a bad parse. Read more
fn from_form_value(
v: &'v RawStr
) -> Result<Ipv4Addr, <Ipv4Addr as FromFormValue<'v>>::Error>[src]
v: &'v RawStr
) -> Result<Ipv4Addr, <Ipv4Addr as FromFormValue<'v>>::Error>
fn default() -> Option<Self>[src]
impl<'a> FromParam<'a> for Ipv4Addr[src]
type Error = &'a RawStr
The associated error to be returned if parsing/validation fails.
fn from_param(
param: &'a RawStr
) -> Result<Ipv4Addr, <Ipv4Addr as FromParam<'a>>::Error>[src]
param: &'a RawStr
) -> Result<Ipv4Addr, <Ipv4Addr as FromParam<'a>>::Error>
impl FromStr for Ipv4Addr[src]
type Err = AddrParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ipv4Addr, AddrParseError>[src]
impl<'x, P> FromUriParam<P, &'x Ipv4Addr> for Ipv4Addr where
P: UriPart,
P: UriPart,
type Target = &'x Ipv4Addr
The resulting type of this conversion.
fn from_uri_param(param: &'x Ipv4Addr) -> &'x Ipv4Addr
impl<'x, P> FromUriParam<P, &'x mut Ipv4Addr> for Ipv4Addr where
P: UriPart,
P: UriPart,
type Target = &'x mut Ipv4Addr
The resulting type of this conversion.
fn from_uri_param(param: &'x mut Ipv4Addr) -> &'x mut Ipv4Addr
impl<P> FromUriParam<P, Ipv4Addr> for Ipv4Addr where
P: UriPart,
P: UriPart,
type Target = Ipv4Addr
The resulting type of this conversion.
fn from_uri_param(param: Ipv4Addr) -> Ipv4Addr
impl Hash for Ipv4Addr[src]
fn hash<H>(&self, s: &mut H) where
H: Hasher, [src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for Ipv4Addr[src]
fn cmp(&self, other: &Ipv4Addr) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<IpAddr> for Ipv4Addr1.16.0[src]
impl PartialEq<Ipv4Addr> for IpAddr1.16.0[src]
impl PartialEq<Ipv4Addr> for Ipv4Addr[src]
impl PartialOrd<IpAddr> for Ipv4Addr1.16.0[src]
fn partial_cmp(&self, other: &IpAddr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool[src]
impl PartialOrd<Ipv4Addr> for IpAddr1.16.0[src]
fn partial_cmp(&self, other: &Ipv4Addr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool[src]
impl PartialOrd<Ipv4Addr> for Ipv4Addr[src]
fn partial_cmp(&self, other: &Ipv4Addr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool[src]
impl Serialize for Ipv4Addr[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer, [src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl<P> UriDisplay<P> for Ipv4Addr where
P: UriPart,
P: UriPart,
This implementation is identical to the Display implementation.
Auto Trait Implementations
impl RefUnwindSafe for Ipv4Addr
impl Send for Ipv4Addr
impl Sync for Ipv4Addr
impl Unpin for Ipv4Addr
impl UnwindSafe for Ipv4Addr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,