Skip to main content

Crate rmut_session

Crate rmut_session 

Source
Expand description

rmut’s mail session: an open mailbox and the operations over it.

Everything here works without a screen. A front end owns the menus, the keys and the drawing, and drives a Session for the rest: what is in the mailbox, what is selected, what a mark or a sync did. Outcomes leave as Notices through the sink the front end installs, so an operation never has to know how it will be shown.

Structs§

CommandRun
What a command line did, for the front end to finish and report.
Compose
A draft file going through editor → send/postpone/discard.
ComposeBase
Snapshot of the message being replied to / forwarded, taken when the compose flow starts.
ComposeSetup
DeleteRules
An operation that has asked the connection for something and is waiting to be carried on. The front end keeps drawing meanwhile, and calls Session::poll_network until the answer lands. How a message is marked for deletion: mutt’s $flag_safe and $delete_untag, read once per operation.
Facts
What the session knows about the open folder without asking the connection. Cheap, and unchanged while a job is in flight.
Held
A message that has been sent but is waiting out $undo_send before it goes anywhere. The finalized text is ready to transmit; the draft it came from is kept whole, so cancelling puts the compose menu back exactly as it was.
Hook
A compiled hook: the pattern its message must match, and what the hook carries (an enter-command line, or an Fcc mailbox).
Imap
A handle on the connection: the facts, and the thread doing the talking.
Msg
MsgMark
One message’s state before a step touched it. The path is the identity: it only changes when the mailbox is written, and a write drops the whole stack.
Session
One open mailbox and everything rmut knows about it.
UndoStep
One undoable step: what it was, the messages as they stood before it, and where the cursor was.

Enums§

Answer
An answer on its way back in.
Ask
A question waiting on an answer.
AskKind
Which question is being answered, and everything the operation was holding when it stopped to ask. The front end carries it back untouched, so nothing about a half-done operation lives in the front end.
ComposeKind
Done
What a job left behind.
FrontOp
The functions a session cannot carry out, because they are about the display rather than the mail: a menu to open, a screen to repaint, an editor to hand the terminal to. The session has done whatever checking it can (a mailbox with unsaved changes will not be left, an unconfigured query will not be prompted for) before handing one of these back, so a front end can act on it directly.
Function
One thing the index can be told to do, under the name mutt gives it. A front end binds keys or menu items to these; bind and :exec name them straight out.
Job
What the session asks the connection to do.
Key
The keystroke answering a Ask::Key. Other is anything the question does not recognise, which usually calls it off.
Manage
One folder-management action, its folder names already stripped of the imap:account/ prefix.
Outcome
What came of running a function.
PageSpot
Where on the visible page the cursor should land.
PatternOp
The pattern operations, mutt’s D/U/T/Ctrl+T.
Request
Something only the front end can do, handed back for it to honour or refuse.
Security
PGP treatment for an outgoing draft, chosen at the send prompt.
SidebarOp
What to do with the mailbox pane.
SortKey
ThreadOp
Wants
What a line answer is, so a front end can help the user give one.

Functions§

account_password
Run the account’s password command once per session. OAuth tokens expire, so those are fetched fresh for every connection instead.
default_from
default_quote_re
mutt’s $quote_regexp default.
draft_full
The draft as a full message: the file as edited, with any withheld header block put back in front.
expand_tilde
header_value
First value of a (single-line) header in a draft head block.
parse_sort
“[reverse-]date|from|subject|size|threads” from the config.
pipe_to
Run a shell command with bytes on its stdin.
run_sendmail
With rcpts the addresses go on the command line (a bounce keeps its Resent-To out of -t’s reach); otherwise -t reads To/Cc/Bcc. The envelope becomes mutt’s -f, -N and -R.
send_via_smtp
sort_browser
A path with a leading ~ expanded, as mutt does everywhere it takes one. mutt’s $sort_browser over browser entries of (spec, new count): alpha (the default), count / unread (by the count), date (by the maildir’s change time; IMAP folders have none and sort first), unsorted (as given), with a “reverse-” prefix flipping any. size reads as alpha: a maildir’s size is not worth a walk.
spawn_url_opener
[ui] url_command over a URL, as Session::open_url runs it, for a front end that has a URL but not the session to hand.
wrap_order
Visit order for a wrapping scan over n entries starting after (before, when backwards) sel: each index paired with a flag set once the walk passed the end (start). The starting index comes last, so a lone match under the cursor still counts as a wrap.
write_draft