diff options
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r-- | src/imap/flow.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs index 6ddd092..e372d69 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 imap_codec::imap_types::core::Tag; use tokio::sync::Notify; 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::*; |