Struct gtk::Value []

pub struct Value(_);

A generic value capable of carrying various types.

Once created the type of the value can't be changed.

Some types (e.g. String and objects) support None values while others (e.g. numeric types) don't.

See the module documentation for more details.

Methods

impl Value

Tries to downcast to a TypedValue.

Returns Ok(TypedValue<T>) if the value carries a type corresponding to T and Err(self) otherwise.

Tries to get a value of type T.

Returns Some if the type is correct and the value is not None.

This function doesn't distinguish between type mismatches and correctly typed None values. Use downcast or is for that.

Returns true if the type of the value corresponds to T.

Returns the type of the value.

Returns whether Values of type src can be transformed to type dst.

Trait Implementations

impl Uninitialized for Value

Returns an uninitialized value.

impl Drop for Value

impl ToValue for Value

Returns a Value clone of self.

Returns the type identifer of self. Read more

impl Debug for Value

Formats the value using the given formatter.

impl<'a> ToGlibPtr<'a, *const GValue> for Value

Transfer: none. Read more

Transfer: container. Read more

Transfer: full. Read more

impl<'a, T> From<Option<&'a T>> for Value where T: SetValueOptional + ?Sized

impl<'a, T> From<&'a T> for Value where T: SetValue + ?Sized

impl<T> From<TypedValue<T>> for Value

impl<'a> ToGlibPtrMut<'a, *mut GValue> for Value

Transfer: none. Read more

impl Clone for Value

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more