Function simics::api::base::attr_value::attr_dict_key

source ·
pub fn attr_dict_key(attr: &AttrValue, index: u32) -> Result<AttrValue>
Expand description

Get a key from an AttrValue dict if it is one, or an error otherwise.

Unlike the C API function, which does not transfer ownership of the key to the caller, this function copies the key and takes ownership of the new key. The old key’s ownership is not changed, and it is not freed.

§Arguments

  • attr - The AttrValue dictionary to get the key from
  • index - The index in the AttrValue associative array dictionary to get the key from

§Return Value

The key for the requested index in the dictionary, or an error otherwise

§Context

All Contexts