Skip to main content

StackMap

Trait StackMap 

Source
pub trait StackMap<'a, V>
where V: Default + Copy,
{ // Required method fn lookup(&self, key: &'a str) -> Option<V>; // Provided method fn export_key_values<const K: usize>(&self, keys: &'a [&str; K]) -> [V; K] { ... } }
Expand description

A trait for looking up parameters in a stack-like environment.

Required Methods§

Source

fn lookup(&self, key: &'a str) -> Option<V>

Looks up a value associated with the given key in the stack.

§Arguments
  • key: The key to look up.
§Returns

An Option<V> containing the value if found, or None if not found.

Provided Methods§

Source

fn export_key_values<const K: usize>(&self, keys: &'a [&str; K]) -> [V; K]

Exports the values for the given keys from the local bindings.

§Arguments
  • keys: An array of keys to look up in the local bindings.
§Returns

An array of values corresponding to the keys. If a key is not found,

§Panics

Panics if any key is not found in the local bindings.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§