Struct dia_ip_range::IPv4Range [−][src]
IPv4 range
A range can be respresented in string, following these rules:
- Start and end are placed inside one of
[]
,[)
…, separated by a comma. [
and]
are inclusive.(
and)
are exclusive.- White spaces can be included. They will be ignored by parser.
- Length of the string must be equal to or smaller than 64 bytes. It’s for protection against flood attack.
Currently this struct is itself useless. You need to enable feature iter
, in order to use IPv4RangeIter
.
Examples
use { core::str::FromStr, dia_ip_range::IPv4Range, }; assert_eq!( IPv4Range::from_str("10.0.0.[2,100)")?, IPv4Range::make([10..=10, 0..=0, 0..=0, 2..=99])?, );
Implementations
impl IPv4Range
[src]
pub fn make(components: [RangeInclusive<u8>; 4]) -> Result<Self>
[src]
Makes new instance
An error is returned if any component is empty.
Trait Implementations
impl Clone for IPv4Range
[src]
impl Debug for IPv4Range
[src]
impl Eq for IPv4Range
[src]
impl FromStr for IPv4Range
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for IPv4Range
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<IPv4Range> for IPv4Range
[src]
impl StructuralEq for IPv4Range
[src]
impl StructuralPartialEq for IPv4Range
[src]
Auto Trait Implementations
impl RefUnwindSafe for IPv4Range
impl Send for IPv4Range
impl Sync for IPv4Range
impl Unpin for IPv4Range
impl UnwindSafe for IPv4Range
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,