pub trait HashMapInstance<'s>: Instance<'s> + 's {
// Required methods
fn get_value<'a>(&'a self, key: &str) -> Option<Value<'a, 's>>
where 's: 'a;
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn boxed_clone(&self) -> Box<dyn HashMapInstance<'s> + 's>;
fn update<'a>(
&'a mut self,
update: &'a (dyn HashMapInstance<'s> + 's),
field_mask: Option<&FieldMask>,
replace_repeated: bool,
) -> Result<(), Error>;
fn values<'a>(&'a self) -> HashMap<String, CowValue<'a, 's>>
where 's: 'a;
fn hashmap_eq(&self, inst: &(dyn HashMapInstance<'s> + 's)) -> bool;
fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>;
// Provided method
fn contains(&self, sub_inst: &(dyn HashMapInstance<'s> + 's)) -> bool { ... }
}Expand description
A reflected HashMap
Required Methods§
fn get_value<'a>(&'a self, key: &str) -> Option<Value<'a, 's>>where
's: 'a,
fn is_empty(&self) -> bool
fn len(&self) -> usize
Sourcefn boxed_clone(&self) -> Box<dyn HashMapInstance<'s> + 's>
fn boxed_clone(&self) -> Box<dyn HashMapInstance<'s> + 's>
Returns a clone of the instance in a Box.
Sourcefn update<'a>(
&'a mut self,
update: &'a (dyn HashMapInstance<'s> + 's),
field_mask: Option<&FieldMask>,
replace_repeated: bool,
) -> Result<(), Error>
fn update<'a>( &'a mut self, update: &'a (dyn HashMapInstance<'s> + 's), field_mask: Option<&FieldMask>, replace_repeated: bool, ) -> Result<(), Error>
Updates an instance based on the instance passed in. If a field mask is specified only the fields passed with the mask will be updated.
Sourcefn values<'a>(&'a self) -> HashMap<String, CowValue<'a, 's>>where
's: 'a,
fn values<'a>(&'a self) -> HashMap<String, CowValue<'a, 's>>where
's: 'a,
Returns a HashMap containing all the attributes of the instance.
fn hashmap_eq(&self, inst: &(dyn HashMapInstance<'s> + 's)) -> bool
fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>
Provided Methods§
fn contains(&self, sub_inst: &(dyn HashMapInstance<'s> + 's)) -> bool
Trait Implementations§
Source§impl<'s> Clone for Box<dyn HashMapInstance<'s> + 's>
impl<'s> Clone for Box<dyn HashMapInstance<'s> + 's>
Source§impl<'s> Debug for dyn HashMapInstance<'s> + 's
impl<'s> Debug for dyn HashMapInstance<'s> + 's
Source§impl<'s> PartialEq for dyn HashMapInstance<'s> + 's
impl<'s> PartialEq for dyn HashMapInstance<'s> + 's
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".