Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 22 fields pub identity: Identity, pub mail: Mail, pub index: Index, pub pager: Pager, pub ui: Ui, pub gui: Gui, pub net: Net, pub sidebar: Sidebar, pub colors: HashMap<String, String>, pub color_index: Vec<ColorRule>, pub color_body: Vec<ColorRule>, pub filters: HashMap<String, String>, pub keys: Keys, pub macros: Keys, pub accounts: Vec<Account>, pub identities: Vec<IdentityRule>, pub folder_hooks: Vec<FolderHook>, pub message_hooks: Vec<MessageHook>, pub reply_hooks: Vec<MessageHook>, pub fcc_hooks: Vec<FccHook>, pub crypt_hooks: Vec<CryptHook>, pub pgp: Pgp,
}

Fields§

§identity: Identity§mail: Mail§index: Index§pager: Pager§ui: Ui§gui: Gui§net: Net§sidebar: Sidebar§colors: HashMap<String, String>§color_index: Vec<ColorRule>

Pattern → color rules for index lines, evaluated in order.

§color_body: Vec<ColorRule>

Regex → color rules for pager body spans (mutt’s color body), applied in order; pattern here is a plain regex, not a message pattern.

§filters: HashMap<String, String>

MIME type → shell command that renders the part (stdin → stdout), e.g. “text/html” = “w3m -dump -T text/html”, mutt’s auto_view. Applied to matching parts wherever they sit in the message, preferred in multipart/alternative, and used in the attachment viewer. An empty command means mutt’s arrangement: the command comes from mailcap, from the first copiousoutput entry for the type; a type with no such entry simply does not autoview.

§keys: Keys§macros: Keys

Macros: a key that replays a sequence of keys, per menu: [macros.index] / [macros.pager], key = "sequence". The sequence is literal characters plus <enter>/<esc>/ <ctrl+x>/… names in angle brackets; it feeds the input queue, so it can drive prompts.

§accounts: Vec<Account>§identities: Vec<IdentityRule>

Conditional identities, applied in order over identity when their globs match: the minimal folder-hook / send-hook.

§folder_hooks: Vec<FolderHook>

mutt’s folder-hook with an arbitrary command: enter-command lines run when a matching mailbox is opened.

§message_hooks: Vec<MessageHook>

mutt’s message-hook: lines applied while a matching message is the selected one, and taken back off when it stops matching.

§reply_hooks: Vec<MessageHook>

mutt’s reply-hook: lines applied while a reply to a matching message is built.

§fcc_hooks: Vec<FccHook>

mutt’s fcc-hook: where a matching outgoing message’s copy goes.

§crypt_hooks: Vec<CryptHook>

mutt’s crypt-hook: the PGP key to encrypt to for a recipient.

§pgp: Pgp

Implementations§

Source§

impl Config

Source

pub fn account(&self, name: &str) -> Option<&Account>

Source

pub fn list_matchers(&self) -> Vec<Matcher>

The identity for a draft, layered like mutt hooks: [identity], then the account’s, then every matching [[identities]] rule in order (a later rule overrides an earlier one; unset fields keep the value below). rcpts are the draft’s bare recipient addresses, empty when they are not known yet, which makes recipient rules not match. Every known mailing-list pattern (lists plus subscribed), compiled for matching against addresses.

Source

pub fn subscribed_matchers(&self) -> Vec<Matcher>

The subscribed half on its own, for the Mail-Followup-To rule.

Source

pub fn alternate_matchers(&self) -> Vec<Matcher>

mutt’s alternates, compiled for matching against a bare address.

Source

pub fn identity_for( &self, folder: &str, rcpts: &[String], account: Option<&Account>, ) -> Identity

Source§

impl Config

Source

pub fn expand_folders(&mut self)

Expand =x / +x in every mailbox the config names, so the rest of the program only ever sees real paths and imap: specs. Idempotent: an expanded name no longer starts with = or +.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Config

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

impl<'de> Deserialize<'de> for Config
where Config: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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.