Struct Name

Source
pub struct Name { /* private fields */ }
Expand description

MailSetup that uses the given service name for a session. It can also attach the instance ID and session ID for better diagnostics.

Using the default instance or setting name to empty string will reuse the incoming service name already set.

Implementations§

Source§

impl Name

Source

pub fn new(name: impl ToString) -> Self

Construct a name MailSetup to use the given service name. This name is used in SMTP responses and will be seen in logs. It is also used to identify a mail transaction.

Source

pub fn identify_instance(self, enable: bool) -> Self

Switch if instance ID should be included in the service name

Source

pub fn identify_session(self, enable: bool) -> Self

Switch if instance ID should be included in the service name

Trait Implementations§

Source§

impl Debug for Name

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Name

Source§

fn default() -> Name

Returns the “default value” for a type. Read more
Source§

impl<T: AcceptsSessionService + HasId> MailSetup<T> for Name

Source§

fn setup(self, config: &mut T)

Add self as an ESMTP service so it can configure service name for each session

Source§

impl SessionService for Name

Source§

fn prepare_session<'a, 'i, 's, 'f>( &'a self, _io: &'i mut Box<dyn MayBeTls>, state: &'s mut SmtpContext, ) -> S1Fut<'f, ()>
where 'a: 'f, 'i: 'f, 's: 'f,

Use a given name as a service name in the session.

Auto Trait Implementations§

§

impl Freeze for Name

§

impl RefUnwindSafe for Name

§

impl Send for Name

§

impl Sync for Name

§

impl Unpin for Name

§

impl UnwindSafe for Name

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.