pub struct SledSnapshotPinRegistry { /* private fields */ }Expand description
Persistent registry of HNSW snapshot block CIDs that must survive GC.
Backed by a dedicated "snapshot_pins" Sled tree inside the blockstore
database. Entries survive process restarts, which is critical for ensuring
snapshot blocks are never collected by the OrphanGarbageCollector even
across node restarts.
Key layout: cid_bytes → label_utf8_bytes
Implementations§
Source§impl SledSnapshotPinRegistry
impl SledSnapshotPinRegistry
Sourcepub fn open(db: &Db) -> Result<Self>
pub fn open(db: &Db) -> Result<Self>
Open (or create) the "snapshot_pins" tree inside the given Sled Db.
Sourcepub fn pin(&self, cid: &Cid, label: &str) -> Result<()>
pub fn pin(&self, cid: &Cid, label: &str) -> Result<()>
Pin cid with a human-readable label. Idempotent — pinning the
same CID again simply overwrites the label.
Sourcepub fn unpin(&self, cid: &Cid) -> Result<()>
pub fn unpin(&self, cid: &Cid) -> Result<()>
Remove the pin for cid. No-ops silently if not present.
Sourcepub fn is_pinned(&self, cid: &Cid) -> Result<bool>
pub fn is_pinned(&self, cid: &Cid) -> Result<bool>
Return true when cid is registered in this registry.
Sourcepub fn list_pinned(&self) -> Result<Vec<(Cid, String)>>
pub fn list_pinned(&self) -> Result<Vec<(Cid, String)>>
Return all pinned CIDs together with their labels.
Sourcepub fn pinned_cid_strings(&self) -> Result<HashSet<String>>
pub fn pinned_cid_strings(&self) -> Result<HashSet<String>>
Build a HashSet<String> of pinned CID strings for use with
OrphanGarbageCollector.
Auto Trait Implementations§
impl !RefUnwindSafe for SledSnapshotPinRegistry
impl !UnwindSafe for SledSnapshotPinRegistry
impl Freeze for SledSnapshotPinRegistry
impl Send for SledSnapshotPinRegistry
impl Sync for SledSnapshotPinRegistry
impl Unpin for SledSnapshotPinRegistry
impl UnsafeUnpin for SledSnapshotPinRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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