Struct rhai::FnResolutionCache
source · pub struct FnResolutionCache {
pub dict: HashMap<u64, Option<FnResolutionCacheEntry>, StraightHasherBuilder>,
pub filter: BloomFilterU64,
}
Expand description
(internals) A function resolution cache with a bloom filter.
Exported under the internals
feature only.
The bloom filter is used to rapidly check whether a function hash has never been encountered. It enables caching a hash only during the second encounter to avoid “one-hit wonders”.
Fields§
§dict: HashMap<u64, Option<FnResolutionCacheEntry>, StraightHasherBuilder>
Hash map containing cached functions.
filter: BloomFilterU64
Bloom filter to avoid caching “one-hit wonders”.
Implementations§
source§impl FnResolutionCache
impl FnResolutionCache
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the FnResolutionCache
.
Trait Implementations§
source§impl Clone for FnResolutionCache
impl Clone for FnResolutionCache
source§fn clone(&self) -> FnResolutionCache
fn clone(&self) -> FnResolutionCache
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FnResolutionCache
impl Debug for FnResolutionCache
source§impl Default for FnResolutionCache
impl Default for FnResolutionCache
source§fn default() -> FnResolutionCache
fn default() -> FnResolutionCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FnResolutionCache
impl !Send for FnResolutionCache
impl !Sync for FnResolutionCache
impl Unpin for FnResolutionCache
impl !UnwindSafe for FnResolutionCache
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> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.