Function simics::api::base::attr_value::attr_dict_set_item

source ·
pub fn attr_dict_set_item<E>(
    attr: &mut AttrValue,
    index: u32,
    key: E,
    value: E,
) -> Result<()>
where E: Into<AttrValue>,
Expand description

Set the element numbered index of the dict attr to key and value. The previous key and value at that position are freed. The ownership for key and value is transferred from the caller to attr. The key must be of integer, string or object type.

This function should generally not be used. Instead, values should be deserialized from the AttrValue, modified in a type-safe way, and serialized back.

§Arguments

  • attr - The attribute dictionary to set an item in
  • index - The numbered index to set. AttrValue dictionaries are associative arrays
  • key - The value to set the key item of the dict to
  • value - The value to set the value item of the dict to

§Context

Cell Context