pub struct PresentRanges { /* private fields */ }Expand description
The chunk ranges of a hash currently present in the store.
This is the presence oracle the range-aware cache API builds on: read
serves only present ranges, resume re-fetches only missing ones, and disk
admission accounts present bytes. Absent and logically-evicted hashes report
empty + not-complete, matching CacheEngine::has’s eviction masking.
Implementations§
Source§impl PresentRanges
impl PresentRanges
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
The whole blob is present.
Sourcepub const fn chunk_ranges(&self) -> &ChunkRanges
pub const fn chunk_ranges(&self) -> &ChunkRanges
The present ranges, in chunk units.
Sourcepub const fn size(&self) -> u64
pub const fn size(&self) -> u64
The blob’s total size in bytes, from the observe() bitfield.
Unlike status(), which iroh-blobs leaves unknown for a partial blob
until its LAST chunk validates, the bitfield knows the full size as
soon as any chunk carries it (a front-prefix partial with no tail
still reports it here). 0 for an absent/evicted/refused hash.
Trait Implementations§
Source§impl Clone for PresentRanges
impl Clone for PresentRanges
Auto Trait Implementations§
impl Freeze for PresentRanges
impl RefUnwindSafe for PresentRanges
impl Send for PresentRanges
impl Sync for PresentRanges
impl Unpin for PresentRanges
impl UnsafeUnpin for PresentRanges
impl UnwindSafe for PresentRanges
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 moreCreates a shared type from an unshared type.