Skip to content

Commit

Permalink
Add Chunk::as_bytes (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoog authored Nov 1, 2023
1 parent a3c1647 commit 126ff13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ impl Chunk {
self.buf.len()
}

/// The bytes already written so far.
pub fn as_bytes(&self) -> &[u8] {
self.buf.as_slice()
}

/// Add all objects from another chunk to this one.
pub fn extend(&mut self, other: &Chunk) {
let base = self.len();
Expand Down

0 comments on commit 126ff13

Please sign in to comment.