pub struct EvictionPreview {
pub size_bytes: Option<u64>,
pub last_accessed_us_ago: Option<u64>,
pub pinned: bool,
pub already_evicted: bool,
pub served: bool,
pub origin_kinds: Vec<OriginKind>,
}Expand description
Read-only snapshot of a hash’s local-cache state, returned by
CacheEngine::inspect. Backs decdn node evict --dry-run
(issue #379): operators running DMCA takedowns want to confirm the blob’s size, last-access
time, pin status, and already-evicted flag before mutating state.
All fields reflect the underlying cache state — size_bytes reads
from the iroh-blobs store directly, so a hash that has already been
logically evicted (and whose bytes are still on disk pending the
follow-up GC sweep in #518) still reports its size here. That keeps
dry-run honest about disk reclaim potential rather than hiding it once
the operator has flipped the evicted flag. For a complete blob the size
is its byte length; for a partial blob it is the validated total (see
Self::size_bytes), and CacheEngine::size_snapshot gives the bytes
it holds on disk.
Fields§
§size_bytes: Option<u64>Bytes the iroh-blobs store reports for this hash. None when the
blob isn’t in the store; matches BlobStatus::NotFound. A partial
blob reports BlobStatus::Partial { size } as is: the whole blob’s
size once its last chunk validates, None before. That is the blob’s
total, not the bytes it holds on disk — the delivery path signs it as
the blob’s total and the probe path advertises it, and
CacheEngine::size_snapshot is the on-disk measure.
last_accessed_us_ago: Option<u64>Microseconds elapsed since the last recorded access to the blob: a
serve, a hit, or a fill. None when the blob has had no access since
open — including a blob on disk at open that nothing has touched since
(its open-time recency seed is not an access) — or when eviction or
quarantine has cleared its entry.
pinned: boolWhether the hash is in the operator-pinned set (#276). Pinning
protects against LRU eviction but not against an explicit
CacheEngine::evict; surfaced here so a dry-run operator can
spot the case before running the takedown.
already_evicted: boolWhether the hash already lives in <cache_dir>/evicted.log.
true means a real CacheEngine::evict would short-circuit
at the idempotency guard at the top of evict() — the dry-run
is reporting on a no-op.
served: boolWhether CacheEngine::has would currently return true for
this hash — equivalently, BlobStatus::Complete and not
already evicted. Pre-computed inside inspect() so the admin
RPC doesn’t need a second has() round-trip to fill the
was_present field on its response.
origin_kinds: Vec<OriginKind>Ordered list of backend kinds the engine would consult on a
post-eviction miss (#439, #284). Empty when no origin is
configured (cache-only mode); otherwise one OriginKind per
entry of the operator-supplied fallback chain, in order.
Operators running takedowns or LRU sweeps use this to estimate
the worst-case origin egress cost — re-pulling from a
Filesystem origin is a local read; re-pulling from Http or
S3 may consume metered bandwidth, and a chain of three S3
origins multiplies the bill on a deep fallback.
Trait Implementations§
Source§impl Clone for EvictionPreview
impl Clone for EvictionPreview
Source§impl Debug for EvictionPreview
impl Debug for EvictionPreview
Source§impl Default for EvictionPreview
impl Default for EvictionPreview
impl Eq for EvictionPreview
Source§impl PartialEq for EvictionPreview
impl PartialEq for EvictionPreview
impl StructuralPartialEq for EvictionPreview
Auto Trait Implementations§
impl Freeze for EvictionPreview
impl RefUnwindSafe for EvictionPreview
impl Send for EvictionPreview
impl Sync for EvictionPreview
impl Unpin for EvictionPreview
impl UnsafeUnpin for EvictionPreview
impl UnwindSafe for EvictionPreview
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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