pub struct DefaultResolver<S, K, V>{ /* private fields */ }Expand description
General-purpose resolver that stores values indexed by name.
DefaultResolver uses a HashMap internally. While the resolve() method
has O(1) complexity, its performance is slower compared to other specialized
resolvers such as SmallResolver or IndexedResolver.
§Advantages
- No restrictions on variable or function names.
- Performance remains stable even with a large number of items.
- No size limit.
§Disadvantages
- Slow resolving names due to the hashing algorithm.
§Examples
use fee::DefaultResolver;
use fee::prelude::*;
let mut var_resolver = DefaultResolver::empty();
var_resolver.insert("p0", 10.0);
assert_eq!(*var_resolver.resolve("p0").unwrap(), 10.0);Implementations§
Source§impl<K, V> DefaultResolver<Unlocked, K, V>
impl<K, V> DefaultResolver<Unlocked, K, V>
Trait Implementations§
Auto Trait Implementations§
impl<S, K, V> Freeze for DefaultResolver<S, K, V>where
S: Freeze,
impl<S, K, V> RefUnwindSafe for DefaultResolver<S, K, V>
impl<S, K, V> Send for DefaultResolver<S, K, V>
impl<S, K, V> Sync for DefaultResolver<S, K, V>
impl<S, K, V> Unpin for DefaultResolver<S, K, V>
impl<S, K, V> UnwindSafe for DefaultResolver<S, K, V>
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