Skip to content

Commit

Permalink
Add method for getting object refs of top-level objects of chunk (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV authored Sep 1, 2024
1 parent 07389e6 commit e6c6a7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = Ref> + '_ {
self.offsets.iter().map(|&(id, _)| id)
}

/// Renumbers the IDs of indirect objects and all indirect references in the
/// chunk and returns the resulting chunk.
///
Expand Down

0 comments on commit e6c6a7d

Please sign in to comment.