pub trait VmDictExt {
// Required methods
fn put(&mut self, key: &str, value: VmValue);
fn put_str(&mut self, key: &str, value: impl AsRef<str>);
fn put_opt_str(&mut self, key: &str, value: Option<impl AsRef<str>>);
fn put_opt(&mut self, key: &str, value: Option<VmValue>);
fn put_bool(&mut self, key: &str, value: bool);
fn put_int(&mut self, key: &str, value: i64);
}Expand description
Field-insertion helpers for a VmValue::Dict backing map.
Implemented for any [DictInsert] map (the transient BTreeMap builders
and the persistent DictMap), so the methods are unavailable on unrelated
maps and cannot be applied by mistake.
Required Methods§
Sourcefn put(&mut self, key: &str, value: VmValue)
fn put(&mut self, key: &str, value: VmValue)
Inserts value under key (owning the key as a String).
Sourcefn put_str(&mut self, key: &str, value: impl AsRef<str>)
fn put_str(&mut self, key: &str, value: impl AsRef<str>)
Inserts a string value built via VmValue::string.
Sourcefn put_opt_str(&mut self, key: &str, value: Option<impl AsRef<str>>)
fn put_opt_str(&mut self, key: &str, value: Option<impl AsRef<str>>)
Inserts a string value only when value is Some.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".