[][src]Enum new_tokio_smtp::ClientId

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

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

impl ClientId[src]

pub fn localhost() -> Self[src]

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

pub fn hostname() -> Self[src]

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.

pub fn try_hostname() -> Option<Self>[src]

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

impl Clone for ClientId[src]

impl Debug for ClientId[src]

impl From<AddressLiteral> for ClientId[src]

impl From<ClientId> for Ehlo[src]

impl From<Domain> for ClientId[src]

impl From<IpAddr> for ClientId[src]

impl From<Ipv4Addr> for ClientId[src]

impl From<Ipv6Addr> for ClientId[src]

impl Into<ClientId> for Ehlo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.