Skip to main content

Imap

Struct Imap 

Source
pub struct Imap {
    pub facts: Facts,
    /* private fields */
}
Expand description

A handle on the connection: the facts, and the thread doing the talking.

Fields§

§facts: Facts

Implementations§

Source§

impl Imap

Source

pub fn new(remote: Remote) -> Imap

Take an open connection onto a thread of its own.

Source

pub fn abort(&self)

mutt’s Ctrl+G: cut the job in flight short. The socket goes down, whatever was blocked on it fails, and the next job reconnects. Does nothing when nothing is running.

Source

pub fn progress_sink(slot: &Arc<Mutex<Option<String>>>) -> Progress

A progress callback that writes where Imap::progress can read it, for the open that happens before there is a thread.

Source

pub fn take_progress(&mut self) -> Option<String>

The last thing the connection said it was doing, taken.

Source

pub fn busy(&self) -> Option<&'static str>

What the connection is doing, if anything.

Source

pub fn start(&mut self, job: Job) -> Result<()>

Send a job off, to be collected later.

Source

pub fn collect(&mut self) -> Option<Result<Done>>

The answer, if the job is done; None while it is still running.

Source

pub fn blocking(&mut self, job: Job) -> Result<Done>

Run a job and wait for it, the way the operations did when they held the connection themselves. Every caller that learns to collect its answer later stops calling this.

Source

pub fn wait(&mut self) -> Result<Done>

Wait for the job in flight. The session uses this to settle what it started before asking for something else: one connection, one conversation.

Source

pub fn take_backfill(&mut self) -> Vec<u32>

The backfill takes the UIDs the open left over; they are only handed out once.

Trait Implementations§

Source§

impl Drop for Imap

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Imap

§

impl !Sync for Imap

§

impl !UnwindSafe for Imap

§

impl Freeze for Imap

§

impl Send for Imap

§

impl Unpin for Imap

§

impl UnsafeUnpin for Imap

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 = !

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.