aboutsummaryrefslogtreecommitdiff
path: root/src/imap/flow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r--src/imap/flow.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs
index 6ddd092..4405e71 100644
--- a/src/imap/flow.rs
+++ b/src/imap/flow.rs
@@ -1,11 +1,12 @@
use std::error::Error as StdError;
use std::fmt;
use std::sync::Arc;
+
use tokio::sync::Notify;
+use imap_codec::imap_types::core::Tag;
use crate::imap::mailbox_view::MailboxView;
use crate::mail::user::User;
-use imap_codec::imap_types::core::Tag;
#[derive(Debug)]
pub enum Error {
@@ -31,6 +32,14 @@ pub enum State {
),
Logout,
}
+impl State {
+ pub fn notify(&self) -> Option<Arc<Notify>> {
+ match self {
+ Self::Idle(_, _, _, _, anotif) => Some(anotif.clone()),
+ _ => None,
+ }
+ }
+}
impl fmt::Display for State {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use State::*;