pub struct ChunkBitmap { /* private fields */ }Expand description
One bit per chunk, LSB first within each byte.
Implementations§
Source§impl ChunkBitmap
impl ChunkBitmap
pub fn new(len: u64) -> Self
Sourcepub fn from_bytes(bits: Vec<u8>, len: u64) -> Result<Self>
pub fn from_bytes(bits: Vec<u8>, len: u64) -> Result<Self>
Rebuild from raw bytes, rejecting a buffer that does not match len.
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn len(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn get(&self, i: u64) -> bool
Sourcepub fn set(&mut self, i: u64) -> bool
pub fn set(&mut self, i: u64) -> bool
Mark chunk i present. Returns true if this call changed it.
pub fn count(&self) -> u64
pub fn is_complete(&self) -> bool
pub fn fill(&mut self)
Trait Implementations§
Source§impl Clone for ChunkBitmap
impl Clone for ChunkBitmap
Source§impl Debug for ChunkBitmap
impl Debug for ChunkBitmap
impl Eq for ChunkBitmap
Source§impl PartialEq for ChunkBitmap
impl PartialEq for ChunkBitmap
impl StructuralPartialEq for ChunkBitmap
Auto Trait Implementations§
impl Freeze for ChunkBitmap
impl RefUnwindSafe for ChunkBitmap
impl Send for ChunkBitmap
impl Sync for ChunkBitmap
impl Unpin for ChunkBitmap
impl UnsafeUnpin for ChunkBitmap
impl UnwindSafe for ChunkBitmap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more