[−][src]Struct imap::extensions::idle::Handle
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<'a, T: Read + Write + 'a> Handle<'a, T>
[src]
impl<'a, T: SetReadTimeout + Read + Write + 'a> Handle<'a, T>
[src]
pub fn set_keepalive(&mut self, interval: Duration)
[src]
Set the keep-alive interval to use when wait_keepalive
is called.
The interval defaults to 29 minutes as dictated by RFC 2177.
pub fn wait_keepalive(self) -> Result<()>
[src]
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.
pub fn wait_timeout(self, timeout: Duration) -> Result<()>
[src]
use wait_with_timeout instead
Block until the selected mailbox changes, or until the given amount of time has expired.
pub fn wait_with_timeout(self, timeout: Duration) -> Result<WaitOutcome>
[src]
Block until the selected mailbox changes, or until the given amount of time has expired.
Trait Implementations
impl<'a, T: Debug + Read + Write> Debug for Handle<'a, T>
[src]
impl<'a, T: Read + Write + 'a> Drop for Handle<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Handle<'a, T>
impl<'a, T> Send for Handle<'a, T> where
T: Send,
T: Send,
impl<'a, T> !Sync for Handle<'a, T>
impl<'a, T> Unpin for Handle<'a, T>
impl<'a, T> !UnwindSafe for Handle<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,