Struct rhai::FnResolutionCache
source · pub struct FnResolutionCache {
pub map: 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§
§map: 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