Function simics::api::base::attr_value::attr_data

source ·
pub fn attr_data<T>(attr: &AttrValue) -> Result<T>
where T: Clone,
Expand description

Get the contained data from an AttrValue if it is a data value, or return an error if it is not.

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

§Arguments

§Return Value

The contained data if the AttrValue is the correct type, or an error otherwise

§Context

All Contexts