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
sourceimpl FnResolutionCache
impl FnResolutionCache
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the FnResolutionCache
.
Trait Implementations
sourceimpl Clone for FnResolutionCache
impl Clone for FnResolutionCache
sourcefn clone(&self) -> FnResolutionCache
fn clone(&self) -> FnResolutionCache
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for FnResolutionCache
impl Debug for FnResolutionCache
sourceimpl Default for FnResolutionCache
impl Default for FnResolutionCache
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more