1.0.0[−][src]Struct validators::prelude::validators_prelude::Ipv6Addr
An IPv6 address.
IPv6 addresses are defined as 128-bit integers in IETF RFC 4291. They are usually represented as eight 16-bit segments.
See IpAddr for a type encompassing both IPv4 and IPv6 addresses.
The size of an Ipv6Addr struct may vary depending on the target operating
system.
Textual representation
Ipv6Addr provides a FromStr implementation. There are many ways to represent
an IPv6 address in text, but in general, each segments is written in hexadecimal
notation, and segments are separated by :. For more information, see
IETF RFC 5952.
Examples
use std::net::Ipv6Addr; let localhost = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1); assert_eq!("::1".parse(), Ok(localhost)); assert_eq!(localhost.is_loopback(), true);
Trait Implementations
impl Clone for Ipv6Addr[src]
impl Copy for Ipv6Addr[src]
impl Debug for Ipv6Addr[src]
impl<'de> Deserialize<'de> for Ipv6Addr[src]
fn deserialize<D>(
deserializer: D
) -> Result<Ipv6Addr, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, [src]
deserializer: D
) -> Result<Ipv6Addr, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for Ipv6Addr[src]
Write an Ipv6Addr, conforming to the canonical style described by RFC 5952.
impl Eq for Ipv6Addr[src]
impl From<[u16; 8]> for Ipv6Addr1.16.0[src]
fn from(segments: [u16; 8]) -> Ipv6Addr[src]
Creates an Ipv6Addr from an eight element 16-bit array.
Examples
use std::net::Ipv6Addr; let addr = Ipv6Addr::from([ 525u16, 524u16, 523u16, 522u16, 521u16, 520u16, 519u16, 518u16, ]); assert_eq!( Ipv6Addr::new( 0x20d, 0x20c, 0x20b, 0x20a, 0x209, 0x208, 0x207, 0x206 ), addr );
impl From<[u8; 16]> for Ipv6Addr1.9.0[src]
fn from(octets: [u8; 16]) -> Ipv6Addr[src]
Creates an Ipv6Addr from a sixteen element byte array.
Examples
use std::net::Ipv6Addr; let addr = Ipv6Addr::from([ 25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8, 17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8, ]); assert_eq!( Ipv6Addr::new( 0x1918, 0x1716, 0x1514, 0x1312, 0x1110, 0x0f0e, 0x0d0c, 0x0b0a ), addr );
impl From<Ipv6Addr> for IpAddr1.16.0[src]
fn from(ipv6: Ipv6Addr) -> IpAddr[src]
Copies this address to a new IpAddr::V6.
Examples
use std::net::{IpAddr, Ipv6Addr}; let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff); assert_eq!( IpAddr::V6(addr), IpAddr::from(addr) );
impl From<u128> for Ipv6Addr1.26.0[src]
fn from(ip: u128) -> Ipv6Addr[src]
Convert a host byte order u128 into an Ipv6Addr.
Examples
use std::net::Ipv6Addr; let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128); assert_eq!( Ipv6Addr::new( 0x1020, 0x3040, 0x5060, 0x7080, 0x90A0, 0xB0C0, 0xD0E0, 0xF00D, ), addr);
impl<'v> FromFormValue<'v> for Ipv6Addr[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<Ipv6Addr, <Ipv6Addr as FromFormValue<'v>>::Error>[src]
v: &'v RawStr
) -> Result<Ipv6Addr, <Ipv6Addr as FromFormValue<'v>>::Error>
fn default() -> Option<Self>[src]
impl<'a> FromParam<'a> for Ipv6Addr[src]
type Error = &'a RawStr
The associated error to be returned if parsing/validation fails.
fn from_param(
param: &'a RawStr
) -> Result<Ipv6Addr, <Ipv6Addr as FromParam<'a>>::Error>[src]
param: &'a RawStr
) -> Result<Ipv6Addr, <Ipv6Addr as FromParam<'a>>::Error>
impl FromStr for Ipv6Addr[src]
type Err = AddrParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ipv6Addr, AddrParseError>[src]
impl<'x, P> FromUriParam<P, &'x Ipv6Addr> for Ipv6Addr where
P: UriPart,
P: UriPart,
type Target = &'x Ipv6Addr
The resulting type of this conversion.
fn from_uri_param(param: &'x Ipv6Addr) -> &'x Ipv6Addr
impl<'x, P> FromUriParam<P, &'x mut Ipv6Addr> for Ipv6Addr where
P: UriPart,
P: UriPart,
type Target = &'x mut Ipv6Addr
The resulting type of this conversion.
fn from_uri_param(param: &'x mut Ipv6Addr) -> &'x mut Ipv6Addr
impl<P> FromUriParam<P, Ipv6Addr> for Ipv6Addr where
P: UriPart,
P: UriPart,
type Target = Ipv6Addr
The resulting type of this conversion.
fn from_uri_param(param: Ipv6Addr) -> Ipv6Addr
impl Hash for Ipv6Addr[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 Ipv6Addr[src]
fn cmp(&self, other: &Ipv6Addr) -> 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 Ipv6Addr1.16.0[src]
impl PartialEq<Ipv6Addr> for IpAddr1.16.0[src]
impl PartialEq<Ipv6Addr> for Ipv6Addr[src]
impl PartialOrd<IpAddr> for Ipv6Addr1.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<Ipv6Addr> for IpAddr1.16.0[src]
fn partial_cmp(&self, other: &Ipv6Addr) -> 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<Ipv6Addr> for Ipv6Addr[src]
fn partial_cmp(&self, other: &Ipv6Addr) -> 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 Ipv6Addr[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 Ipv6Addr where
P: UriPart,
P: UriPart,
This implementation is identical to the Display implementation.
Auto Trait Implementations
impl RefUnwindSafe for Ipv6Addr
impl Send for Ipv6Addr
impl Sync for Ipv6Addr
impl Unpin for Ipv6Addr
impl UnwindSafe for Ipv6Addr
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>,