pub struct NodeRangedStore { /* private fields */ }Expand description
Node-side RangedStore: a per-blob view over the iroh-blobs cache.
Implementations§
Source§impl NodeRangedStore
impl NodeRangedStore
Sourcepub const fn new(engine: CacheEngine, hash: Hash, total_bytes: u64) -> Self
pub const fn new(engine: CacheEngine, hash: Hash, total_bytes: u64) -> Self
Wrap engine’s view of hash (a total_bytes-byte blob) as a
RangedStore. engine is cheap to clone (Arc-backed), so this
holds it by value rather than behind an extra Arc.
Sourcepub const fn engine(&self) -> &CacheEngine
pub const fn engine(&self) -> &CacheEngine
The wrapped CacheEngine handle. Lets a node-crate wrapper (#1621 Task
10, NodeAdmitStore) reach the engine’s admit_bao_stream without
duplicating the (engine, hash, total_bytes) triple it already holds.
Sourcepub fn refuses(&self) -> bool
pub fn refuses(&self) -> bool
Does a deny/blacklist/evict/quarantine gate currently refuse this hash? A
pure in-memory check (CacheEngine::refuses reads in-memory sets and
never awaits a store hop), so the serve encoder can fold takedown into its per-leaf
presence check without a store round trip. Mirrors the guard
CacheEngine::present_ranges applies before it answers presence.
Trait Implementations§
Source§impl Debug for NodeRangedStore
impl Debug for NodeRangedStore
Source§impl RangedStore for NodeRangedStore
impl RangedStore for NodeRangedStore
Source§fn total_bytes(&self) -> u64
fn total_bytes(&self) -> u64
Source§fn present_ranges(&self) -> RangedFuture<'_, ChunkRanges>
fn present_ranges(&self) -> RangedFuture<'_, ChunkRanges>
Source§fn missing_ranges(
&self,
byte_offset: u64,
byte_len: u64,
) -> RangedFuture<'_, ChunkRanges>
fn missing_ranges( &self, byte_offset: u64, byte_len: u64, ) -> RangedFuture<'_, ChunkRanges>
[byte_offset, byte_offset+byte_len) (byte_len == 0 ⇒ to end) minus what is present.Source§fn admit(&self, range: AlignedRange, bao_bytes: Bytes) -> RangedFuture<'_, ()>
fn admit(&self, range: AlignedRange, bao_bytes: Bytes) -> RangedFuture<'_, ()>
bao_bytes for range against the root in
transit, write data + proof, record the range. Idempotent per range.Source§fn read(&self, byte_offset: u64, byte_len: u64) -> RangedFuture<'_, Bytes>
fn read(&self, byte_offset: u64, byte_len: u64) -> RangedFuture<'_, Bytes>
[byte_offset, byte_offset+byte_len) span.
The returned span is collected into Bytes, so callers (e.g. a
future gap-driven driver) should request gap-sized spans rather than
whole blobs to stay O(gap) in memory.Source§fn is_complete(&self) -> RangedFuture<'_, bool>
fn is_complete(&self) -> RangedFuture<'_, bool>
Source§fn finalize(&self) -> RangedFuture<'_, ()>
fn finalize(&self) -> RangedFuture<'_, ()>
Incomplete if any range is still missing.Source§impl ServeStore for NodeRangedStore
impl ServeStore for NodeRangedStore
Source§fn observe(&self) -> RangedFuture<'_, PresentRangeWatch>
fn observe(&self) -> RangedFuture<'_, PresentRangeWatch>
Source§fn encode_range(
&self,
byte_offset: u64,
byte_len: u64,
) -> RangedFuture<'_, EncodeStream>
fn encode_range( &self, byte_offset: u64, byte_len: u64, ) -> RangedFuture<'_, EncodeStream>
[byte_offset, byte_offset + byte_len) into header-less wire bao.Auto Trait Implementations§
impl !RefUnwindSafe for NodeRangedStore
impl !UnwindSafe for NodeRangedStore
impl Freeze for NodeRangedStore
impl Send for NodeRangedStore
impl Sync for NodeRangedStore
impl Unpin for NodeRangedStore
impl UnsafeUnpin for NodeRangedStore
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
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> ⓘ
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> ⓘ
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