diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-30 11:28:03 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-30 11:28:03 +0200 |
commit | 497ad4b5eae7a2ddf3d7a945313c478d23414249 (patch) | |
tree | fa0ca569cfd41a5cc12547f3f83395b6324b9bd7 /src/imap/flow.rs | |
parent | 4adaa988aa775b0b5303501b3c8c23921b13f76b (diff) | |
download | aerogramme-497ad4b5eae7a2ddf3d7a945313c478d23414249.tar.gz aerogramme-497ad4b5eae7a2ddf3d7a945313c478d23414249.zip |
Split out Examined state and add prototypes for IMAP command handlers
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r-- | src/imap/flow.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs index e1ea99f..feb78ac 100644 --- a/src/imap/flow.rs +++ b/src/imap/flow.rs @@ -19,12 +19,15 @@ pub enum State { NotAuthenticated, Authenticated(User), Selected(User, MailboxView), + // Examined is like Selected, but indicates that the mailbox is read-only + Examined(User, MailboxView), Logout, } pub enum Transition { None, Authenticate(User), + Examine(MailboxView), Select(MailboxView), Unselect, Logout, @@ -38,7 +41,9 @@ impl State { (s, Transition::None) => Ok(s), (State::NotAuthenticated, Transition::Authenticate(u)) => Ok(State::Authenticated(u)), (State::Authenticated(u), Transition::Select(m)) => Ok(State::Selected(u, m)), + (State::Authenticated(u), Transition::Examine(m)) => Ok(State::Examined(u, m)), (State::Selected(u, _), Transition::Unselect) => Ok(State::Authenticated(u)), + (State::Examined(u, _), Transition::Unselect) => Ok(State::Authenticated(u)), (_, Transition::Logout) => Ok(State::Logout), _ => Err(Error::ForbiddenTransition), } |