Enum decon_spf::mechanism::Kind[][src]

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

Represents a Mechanism of type A

Possible Values:

a   
a/24  
a:example.com  
a:example.com/24  

MX

Represents a Mechanism of type MX
Possible values follow the same loyout as for A

Include

Represents a Mechanism of type Include

include:<domain>

IpV4

Represents a Mechanism of type ip4

Example Values:

ip4:192.168.11.0/24  
ip4:10.10.1.1

IpV6

Represents a Mechanism of type ip6

Ptr

Represents a Mechanism of type ptr

Note:

This is rarely use.

Exists

Represents a Mechanism of type exists

 ptr
 ptr:<domain>

All

Represents a Mechanism of type All

Implementations

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

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);

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.

Examples:
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);

Trait Implementations

Returns a copy of the value. Read more

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 !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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)

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.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.