pub enum Kind {
Redirect,
A,
MX,
Include,
IpV4,
IpV6,
Ptr,
Exists,
All,
}
Expand description
Defines the possible mechanisms.
Variants§
Redirect
Represents a Modifier of type redirect=
If this is present, the All mechanism should not be present.
A
MX
Represents a Mechanism of type MX
Possible values follow the same layout as for A
Include
Represents a Mechanism of type Include
include:<domain>
IpV4
IpV6
Represents a Mechanism of type ip6
Ptr
Exists
Represents a Mechanism of type exists
ptr
ptr:<domain>
All
Represents a Mechanism of type All
Implementations§
source§impl Kind
impl Kind
sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
Returns true
if the mechanism is Redirect
.
sourcepub fn is_include(&self) -> bool
pub fn is_include(&self) -> bool
Returns true
if the mechanism is Include
.
sourcepub fn is_ip(&self) -> bool
pub fn is_ip(&self) -> bool
Returns true
if it is of any ip. V4 or V6
§Examples:
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);
Trait Implementations§
source§impl<'de> Deserialize<'de> for Kind
impl<'de> Deserialize<'de> for Kind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Kind
impl PartialEq for Kind
impl Copy for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more