cast_value
function · ferroui-base · v0.5.0
fn cast_value<T: PropertyValue>(value: Option<&crate::BoxedValue>) -> Option<T>
Casts an untyped value to T: the equivalent of a type test followed by
a cast, where null is accepted by types that can be null.
A value casts to T if it is a T, if T is the "any value" type
(Option<BoxedValue> or BoxedValue), if T is the nullable form
(Option<U>) of the value's type, or if it is an object handle that
casts to the handle type T. Null casts to Option<U> and to
Option<BoxedValue>. A &'static str casts to String. No other
conversion (numeric, parsing, to text) is attempted.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.