diff --git a/src/chunk.rs b/src/chunk.rs index dcdede9..102eed7 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -47,6 +47,12 @@ impl Chunk { .extend(other.offsets.iter().map(|&(id, offset)| (id, base + offset))); } + /// An iterator over the references of the top-level objects + /// of the chunk, in the order they appear in the chunk. + pub fn refs(&self) -> impl IntoIterator + '_ { + self.offsets.iter().map(|&(id, _)| id) + } + /// Renumbers the IDs of indirect objects and all indirect references in the /// chunk and returns the resulting chunk. ///