pub enum ClientId {
    Domain(Domain),
    AddressLiteral(AddressLiteral),
}
Expand description

Represents the identity of an client

If you connect to an MSA this can be as simple as localhost, through for smtp communication between servers or for connecting with an MX server this should be a public facing domain or ip address


MSA: Mail Submission Agent

MX: Mail Exchanger

Variants§

§

Domain(Domain)

a registered domain

§

AddressLiteral(AddressLiteral)

a ipv4/ipv6 address, through theoretically others protocols are possible too

Implementations§

creates a client identity for “localhost” (here fixed to 127.0.0.1)

This can be used as client identity when connecting a mail client to a Mail Submission Agent (MSA), but should not be used when connecting to an Mail Exchanger (MX).

creates a client identity using hostname (fallback localhost)

This uses the hostname crate to create a client identity. If this fails ClientId::localhost() is used.

creates a client identity if a hostname can be found

Implementation Note

As the hostname crate currently only returns an Option we also do so.

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
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts this type into the (usually inferred) input type.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.