diff options
author | Quentin <quentin@dufour.io> | 2024-02-23 17:32:38 +0000 |
---|---|---|
committer | Quentin <quentin@dufour.io> | 2024-02-23 17:32:38 +0000 |
commit | d92ae5220cdaddf941da5a216fbd2c3549ccdec3 (patch) | |
tree | 464814294b6e50811e0c667cd1430c6855006f8a /src/imap/flow.rs | |
parent | 0bb7cdf696190200d1885ec822518ac45b685a9b (diff) | |
parent | 1ea3de30995b434c4e59123c1ab634d89a0274b5 (diff) | |
download | aerogramme-d92ae5220cdaddf941da5a216fbd2c3549ccdec3.tar.gz aerogramme-d92ae5220cdaddf941da5a216fbd2c3549ccdec3.zip |
Merge pull request 'Perf measurement & bottleneck fix' (#102) from perf/cpu-ram-bottleneck into main0.2.2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/102
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::*; |