pub enum Kind {
Redirect,
A,
MX,
Include,
IpV4,
IpV6,
Ptr,
Exists,
All,
}
Expand description
This enum defines the possible mechanisms.
Represents a Modifier of type redirect=
If this is present, the All mechanism should not be present.
Represents a Mechanism of type A
a
a/24
a:example.com
a:example.com/24
Represents a Mechanism of type MX
Possible values follow the same loyout as for A
Represents a Mechanism of type Include
Represents a Mechanism of type ip4
ip4:192.168.11.0/24
ip4:10.10.1.1
Represents a Mechanism of type ip6
Represents a Mechanism of type ptr
This is rarely use.
Represents a Mechanism of type exists
Represents a Mechanism of type All
Returns true
if the mechanism is Redirect
.
Returns true
if the mechanism is A
.
Returns true
if the mechanism is MX
.
Returns true
if the mechanism is Include
.
Returns true
if it is of any ip. V4 or V6
let ip4 = Kind::IpV4;
let ip6 = Kind::IpV6;
assert_eq!(ip4.is_ip_v4(), true);
assert_eq!(ip4.is_ip_v6(), false);
assert_eq!(ip4.is_ip(), true);
assert_eq!(ip6.is_ip_v6(), true);
assert_eq!(ip6.is_ip_v4(), false);
assert_eq!(ip6.is_ip(), true);
Returns true
if the mechanism is IpV4
.
Returns true
if the mechanism is IpV6
.
Returns true
if the mechanism is Ptr
.
Returns true
if the mechanism is Exists
.
Returns true
if the mechanism is All
.
Returns a reference to the str for kind enums.
let a = Kind::A;
let mx = Kind::MX;
assert_eq!(a.as_str(), "a");
assert_eq!(a.is_a(), true);
assert_eq!(mx.as_str(), "mx");
assert_eq!(mx.is_mx(), true);
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.