diff --git a/src/types/fetch.rs b/src/types/fetch.rs index 9d497dc..8ea6370 100644 --- a/src/types/fetch.rs +++ b/src/types/fetch.rs @@ -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 diff --git a/src/types/name.rs b/src/types/name.rs index 915cc93..e9808fd 100644 --- a/src/types/name.rs +++ b/src/types/name.rs @@ -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.