Struct glib::value::BoxedValue [−][src]
pub struct BoxedValue(pub Value);
Methods from Deref<Target = Value>
Tries to get a value of type T
.
Returns Ok
if the type is correct.
Returns true
if the type of the value corresponds to T
or is a sub-type of T
.
Tries to transform the value into a value of the target type
Tries to cast the contents of self
into a type appropriate
to store in dest_value
, e.g. to transform a G_TYPE_INT
value
into a G_TYPE_FLOAT
value. Performing transformations between
value types might incur precision lossage. Especially
transformations into strings might reveal seemingly arbitrary
results and shouldn’t be relied upon for production code (such
as rcfile value or object property serialization).
dest_value
Target value.
Returns
Whether a transformation rule was found and could be applied.
Upon failing transformations, dest_value
is left untouched.
Trait Implementations
type Checker = GenericValueTypeOrNoneChecker<Self>
type Checker = GenericValueTypeOrNoneChecker<Self>
Value type checker.
Get the contained value from a Value
. Read more
Returns the type identifier of Self
.
Convert an Option
to a Value
.
type Type = BoxedValue
type Type = BoxedValue
Type to get the Type
from. Read more
Auto Trait Implementations
impl RefUnwindSafe for BoxedValue
impl !Send for BoxedValue
impl !Sync for BoxedValue
impl Unpin for BoxedValue
impl UnwindSafe for BoxedValue
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,