pub struct MegamorphicCache { /* private fields */ }Implementations§
Source§impl MegamorphicCache
impl MegamorphicCache
Sourcepub fn hash_key(schema_id: u64, field_name: &str) -> u64
pub fn hash_key(schema_id: u64, field_name: &str) -> u64
Combines a schema_id and field name into a hash key.
Uses FNV-1a-inspired mixing: fold the field name bytes into the schema_id with multiply-xor rounds.
Sourcepub fn probe(&self, key: u64) -> Option<(u16, u16)>
pub fn probe(&self, key: u64) -> Option<(u16, u16)>
Probes the cache for a matching entry.
Returns Some((field_idx, field_type_tag)) on hit, None on miss.
Sourcepub fn insert(&mut self, key: u64, field_idx: u16, field_type_tag: u16)
pub fn insert(&mut self, key: u64, field_idx: u16, field_type_tag: u16)
Inserts an entry at the direct-mapped position (key % CACHE_SIZE). Overwrites any existing entry at that index.
Sourcepub fn invalidate_all(&mut self)
pub fn invalidate_all(&mut self)
Marks all entries as invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MegamorphicCache
impl RefUnwindSafe for MegamorphicCache
impl Send for MegamorphicCache
impl Sync for MegamorphicCache
impl Unpin for MegamorphicCache
impl UnsafeUnpin for MegamorphicCache
impl UnwindSafe for MegamorphicCache
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
Mutably borrows from an owned value. Read more
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>
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