Returns an iterator over the meta keys in this header
(&self)
| 83 | impl Header { |
| 84 | /// Returns an iterator over the meta keys in this header |
| 85 | pub fn metadata(&self) -> impl Iterator<Item = (&[u8], &[u8])> { |
| 86 | let mut last = 0; |
| 87 | self.meta_offsets.chunks_exact(2).map(move |w| { |
| 88 | let start = last; |
| 89 | last = w[1]; |
| 90 | (&self.meta_buf[start..w[0]], &self.meta_buf[w[0]..w[1]]) |
| 91 | }) |
| 92 | } |
| 93 | |
| 94 | /// Returns the value for a given metadata key if present |
| 95 | pub fn get(&self, key: impl AsRef<[u8]>) -> Option<&[u8]> { |
no outgoing calls