Struct imap::extensions::idle::Handle

source ·
pub struct Handle<'a, T: Read + Write + 'a> { /* private fields */ }
Expand description

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

Block until the selected mailbox changes.

Set the keep-alive interval to use when wait_keepalive is called.

The interval defaults to 29 minutes as dictated by RFC 2177.

Block until the selected mailbox changes.

This method differs from Handle::wait in that it will periodically refresh the IDLE connection, to prevent the server from timing out our connection. The keepalive interval is set to 29 minutes by default, as dictated by RFC 2177, but can be changed using Handle::set_keepalive.

This is the recommended method to use for waiting.

Block until the selected mailbox changes, or until the given amount of time has expired.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

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