Implement get() for Fetch and Name

This commit is contained in:
Todd Mortimer 2021-07-31 19:26:48 -04:00
parent 54bca3eddb
commit efd0eadafe
2 changed files with 10 additions and 0 deletions

View file

@ -81,6 +81,11 @@ impl Fetches {
pub fn is_empty(&self) -> bool {
self.borrow_fetches().is_empty()
}
/// Get the element at the given index
pub fn get(&self, index: usize) -> Option<&Fetch<'_>> {
self.borrow_fetches().get(index)
}
}
/// An IMAP [`FETCH` response](https://tools.ietf.org/html/rfc3501#section-7.4.2) that contains

View file

@ -58,6 +58,11 @@ impl Names {
pub fn is_empty(&self) -> bool {
self.borrow_names().is_empty()
}
/// Get the element at the given index
pub fn get(&self, index: usize) -> Option<&Name<'_>> {
self.borrow_names().get(index)
}
}
/// A name that matches a `LIST` or `LSUB` command.