Account

Struct Account 

Source
pub struct Account<'a> { /* private fields */ }
Expand description

Represents the configuration of a specific account

Implementations§

Source§

impl Account<'_>

Source

pub fn name(&self) -> &String

The name of the account

Source

pub fn local(&self) -> &str

The directory where mail is stored locally

Source

pub fn remote(&self) -> Option<&str>

The remote IMAP server

Source

pub fn user(&self) -> Option<&str>

The user name to log in to the remote server

Source

pub fn send_from(&self) -> Option<&str>

The “From” address to use when sending mail

Can be just an email address or “Some Name name@example.com”.

Source

pub fn send_user(&self) -> Option<&str>

The user name to log in when sending mail

If not explicitly configured, this returns the value of user().

Source

pub fn send_remote(&self) -> Option<&str>

The remote SMTP server

If not explicitly configured, this returns the value of remote().

Source

pub fn password(&self) -> Result<Option<String>, ConfigError>

The password to log in to the remote server

Potentially executes a configured command to retrieve the password. Returns an error if the password command has to be executed and fails. Can return Ok(None) if neither a password nor a password command are configured. Otherwise, returns the password.

Source

pub fn send_password(&self) -> Result<Option<String>, ConfigError>

The password to log in to the remote server for sending mail

Potentially executes a configured command to retrieve the password. Returns an error if the password command has to be executed and fails. Can return Ok(None) if neither a password nor a password command are configured. Otherwise, returns the password.

Unless explicitly configured by the user, this returns the value of password().

Auto Trait Implementations§

§

impl<'a> Freeze for Account<'a>

§

impl<'a> RefUnwindSafe for Account<'a>

§

impl<'a> Send for Account<'a>

§

impl<'a> Sync for Account<'a>

§

impl<'a> Unpin for Account<'a>

§

impl<'a> UnwindSafe for Account<'a>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.