Function simics::api::base::attr_value::attr_boolean
source · pub fn attr_boolean(attr: &AttrValue) -> Result<bool>
Expand description
Get an AttrValue
as a boolean if it is one, or return an error
§Arguments
attr
- TheAttrValue
to attempt to get asbool
§Return Value
The contained boolean value if the AttrValue
is the correct type,
or an error otherwise.
§Notes
Conversion via TryInto
should be preferred. For example:
ⓘ
let x: bool = a.try_into()?;
§Context
All Contexts