[][src]Struct async_imap::extensions::idle::Handle

pub struct Handle<T: Read + Write + Unpin + Debug> { /* fields omitted */ }

Handle allows a client to block waiting for changes to the remote mailbox.

The handle blocks using the IDLE command specificed in RFC 2177 until the underlying server state changes in some way. While idling does inform the client what changes happened on the server, this implementation will currently just block until anything changes, and then notify the

Note that the server MAY consider a client inactive if it has an IDLE command running, and if such a server has an inactivity timeout it MAY log the client off implicitly at the end of its timeout period. Because of that, clients using IDLE are advised to terminate the IDLE and re-issue it at least every 29 minutes to avoid being logged off. [Handle::wait_keepalive] does this. This still allows a client to receive immediate mailbox updates even though it need only "poll" at half hour intervals.

As long as a Handle is active, the mailbox cannot be otherwise accessed.

Implementations

impl<T: Read + Write + Unpin + Debug + Send> Handle<T>[src]

pub fn wait(
    &mut self
) -> (impl Future<Output = Result<IdleResponse>> + '_, StopSource)
[src]

Start listening to the server side resonses. Must be called after Handle::init.

pub fn wait_with_timeout(
    &mut self,
    timeout: Duration
) -> (impl Future<Output = Result<IdleResponse>> + '_, StopSource)
[src]

Start listening to the server side resonses, stops latest after the passed in timeout. Must be called after Handle::init.

pub async fn init<'_>(&'_ mut self) -> Result<()>[src]

Initialise the idle connection by sending the IDLE command to the server.

pub async fn done(__arg0: Self) -> Result<Session<T>>[src]

Signal that we want to exit the idle connection, by sending the DONE command to the server.

Trait Implementations

impl<T: Debug + Read + Write + Unpin> Debug for Handle<T>[src]

impl<T: Read + Write + Unpin + Debug + Send> Stream for Handle<T>[src]

type Item = Result<ResponseData>

Values yielded by the stream.

impl<T: Read + Write + Unpin + Debug> Unpin for Handle<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Handle<T>

impl<T> Send for Handle<T> where
    T: Send

impl<T> Sync for Handle<T> where
    T: Sync

impl<T> !UnwindSafe for Handle<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoStream for I where
    I: Stream
[src]

type Item = <I as Stream>::Item

The type of the elements being iterated over.

type IntoStream = I

Which kind of stream are we turning this into?

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]