Skip to content

Commit 7ddd1c1

Browse files
committed
Add Session.select_condstore()
1 parent 0537d10 commit 7ddd1c1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/client.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,25 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Session<T> {
400400
Ok(mbox)
401401
}
402402

403+
/// Selects a mailbox with `(CONDSTORE)` parameter as defined in [RFC
404+
/// 7162](https://www.rfc-editor.org/rfc/rfc7162.html#section-3.1.8).
405+
pub async fn select_condstore<S: AsRef<str>>(&mut self, mailbox_name: S) -> Result<Mailbox> {
406+
let id = self
407+
.run_command(&format!(
408+
"SELECT {} (CONDSTORE)",
409+
validate_str(mailbox_name.as_ref())?
410+
))
411+
.await?;
412+
let mbox = parse_mailbox(
413+
&mut self.conn.stream,
414+
self.unsolicited_responses_tx.clone(),
415+
id,
416+
)
417+
.await?;
418+
419+
Ok(mbox)
420+
}
421+
403422
/// The `EXAMINE` command is identical to [`Session::select`] and returns the same output;
404423
/// however, the selected mailbox is identified as read-only. No changes to the permanent state
405424
/// of the mailbox, including per-user state, will happen in a mailbox opened with `examine`;

0 commit comments

Comments
 (0)