pub struct PrefixPageRegistry<const ENTRIES: usize, const PAGES: usize> { /* private fields */ }Expand description
Fixed-capacity prefix-page index. Lookup/insert/evict never allocate.
Implementations§
Source§impl<const ENTRIES: usize, const PAGES: usize> PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> PrefixPageRegistry<ENTRIES, PAGES>
pub const fn new() -> Self
pub fn get(&self, identity: PrefixIdentity) -> Option<&PrefixPageSet<PAGES>>
Sourcepub fn insert(&mut self, set: PrefixPageSet<PAGES>) -> Result<(), RegistryError>
pub fn insert(&mut self, set: PrefixPageSet<PAGES>) -> Result<(), RegistryError>
Insert or update. Once full, deterministic round-robin replacement bounds retention.
Sourcepub fn insert_replacing(
&mut self,
set: PrefixPageSet<PAGES>,
) -> Result<Option<PrefixPageSet<PAGES>>, RegistryError>
pub fn insert_replacing( &mut self, set: PrefixPageSet<PAGES>, ) -> Result<Option<PrefixPageSet<PAGES>>, RegistryError>
Insert or update and return the replaced page set to its resource owner.
The registry itself stores identifiers only; a KV prefix owner uses this return value to release physical-page references without leaking them on update or round-robin eviction.
pub fn remove(&mut self, identity: PrefixIdentity) -> bool
Sourcepub fn remove_entry(
&mut self,
identity: PrefixIdentity,
) -> Option<PrefixPageSet<PAGES>>
pub fn remove_entry( &mut self, identity: PrefixIdentity, ) -> Option<PrefixPageSet<PAGES>>
Remove and return an entry so the physical-page owner can release its references.
Trait Implementations§
Auto Trait Implementations§
impl<const ENTRIES: usize, const PAGES: usize> Freeze for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> RefUnwindSafe for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> Send for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> Sync for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> Unpin for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> UnsafeUnpin for PrefixPageRegistry<ENTRIES, PAGES>
impl<const ENTRIES: usize, const PAGES: usize> UnwindSafe for PrefixPageRegistry<ENTRIES, PAGES>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.