stop_on_any (extensions/idle.rs)

rust-imap · src/extensions/idle.rs · rust · Apache-2.0
email

Implements IMAP IDLE support with a convenient stop_on_any helper.

// Source: https://github.com/jonhoo/rust-imap | License: Apache-2.0 | Copyright 2016 Matt McCoy
// Provided via justclaw.it.com; keep this notice with the code.
//! Adds support for the IMAP IDLE command specified in [RFC
//! 2177](https://tools.ietf.org/html/rfc2177).

use crate::client::Session;
use crate::error::{Error, Result};
use crate::parse::parse_idle;
use crate::types::UnsolicitedResponse;
use crate::Connection;
#[cfg(feature = "native-tls")]
use native_tls::TlsStream;
#[cfg(feature = "rustls-tls")]
use rustls_connector::TlsStream as RustlsStream;
use std::io::{self, Read, Write};
use std::net::TcpStream;
use std::ops::DerefMut;
use std::time::Duration;

/// `Handle` allows a client to block waiting for changes to the remote mailbox.
///
/// The handle blocks using the [`IDLE` c

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key