Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
add documentation to Bitmap::as_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 2, 2021
1 parent 8300684 commit 65b70c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bitmap/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ impl Bitmap {

impl Bitmap {
/// Returns the byte slice of this Bitmap.
///
/// The returned tuple contains:
/// .1 -> The byte slice, truncated to the start of the first bit. So the start of the slice
/// is within the first 8 bits.
/// .2 -> The start offset in bits, given what described above `0 <= offsets < 8`.
/// .3 -> The length in bits.
#[inline]
pub fn as_slice(&self) -> (&[u8], usize, usize) {
let start = self.offset / 8;
Expand Down

0 comments on commit 65b70c3

Please sign in to comment.