Implement get() for Fetch and Name
This commit is contained in:
parent
54bca3eddb
commit
efd0eadafe
2 changed files with 10 additions and 0 deletions
|
|
@ -81,6 +81,11 @@ impl Fetches {
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.borrow_fetches().is_empty()
|
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
|
/// An IMAP [`FETCH` response](https://tools.ietf.org/html/rfc3501#section-7.4.2) that contains
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,11 @@ impl Names {
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.borrow_names().is_empty()
|
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.
|
/// A name that matches a `LIST` or `LSUB` command.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue