Returns the first item as a lazy mirror, or None if empty.
(&self)
| 189 | |
| 190 | /// Returns the first item as a lazy mirror, or None if empty. |
| 191 | pub fn first(&self) -> Result<Option<T::Lazy>> { |
| 192 | if self.is_empty() { |
| 193 | Ok(None) |
| 194 | } else { |
| 195 | Ok(Some(self.get_lazy(0)?)) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /// Returns the last item as a lazy mirror, or None if empty. |
| 200 | pub fn last(&self) -> Result<Option<T::Lazy>> { |