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

Added documentation to Bitmap::as_slice #654

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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