pub struct PinnedHashes(/* private fields */);Expand description
Operator-pinned blob hashes (#276). Hashes here are excluded from the
LRU eviction-candidate snapshot. Constructing this type is the only
way to feed pinned hashes into CacheEngine::open_with_pinned or
CacheEngine::set_pinned, so a future “blocklist” or similar
HashSet<Hash>-shaped feature can’t be silently passed into the
pinning slot.
Held as Arc<HashSet<Hash>> internally so reload paths that swap the
active set don’t need to clone the underlying map.
Implementations§
Source§impl PinnedHashes
impl PinnedHashes
Sourcepub fn new(set: HashSet<Hash>) -> PinnedHashes
pub fn new(set: HashSet<Hash>) -> PinnedHashes
Build a PinnedHashes from a freshly parsed set.
Sourcepub fn empty() -> PinnedHashes
pub fn empty() -> PinnedHashes
The empty pinned set.
Sourcepub fn diff(&self, prev: &PinnedHashes) -> PinDiff
pub fn diff(&self, prev: &PinnedHashes) -> PinDiff
Compute counts of additions / removals between prev (older
snapshot) and self (newer). Used by the SIGHUP reload path to
log a diff line — operators pin/unpin individual hashes and want
to see the delta in the success log without scraping the full set.
Trait Implementations§
Source§impl Clone for PinnedHashes
impl Clone for PinnedHashes
Source§fn clone(&self) -> PinnedHashes
fn clone(&self) -> PinnedHashes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PinnedHashes
impl Debug for PinnedHashes
Source§impl Default for PinnedHashes
impl Default for PinnedHashes
Source§fn default() -> PinnedHashes
fn default() -> PinnedHashes
Source§impl<'a> IntoIterator for &'a PinnedHashes
impl<'a> IntoIterator for &'a PinnedHashes
Auto Trait Implementations§
impl Freeze for PinnedHashes
impl RefUnwindSafe for PinnedHashes
impl Send for PinnedHashes
impl Sync for PinnedHashes
impl Unpin for PinnedHashes
impl UnsafeUnpin for PinnedHashes
impl UnwindSafe for PinnedHashes
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<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