Struct glib::value::Value
[−]
[src]
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
[src]
fn downcast<'a, T: FromValueOptional<'a> + SetValue>(
self
) -> Result<TypedValue<T>, Self>
[−]
self
) -> Result<TypedValue<T>, Self>
Tries to downcast to a TypedValue
.
Returns Ok(TypedValue<T>)
if the value carries a type corresponding
to T
and Err(self)
otherwise.
fn get<'a, T: FromValueOptional<'a>>(&'a self) -> Option<T>
[−]
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.
fn is<'a, T: FromValueOptional<'a> + SetValue>(&self) -> bool
[−]
Returns true
if the type of the value corresponds to T
.
fn type_(&self) -> Type
[−]
Returns the type of the value.
fn type_transformable(src: Type, dst: Type) -> bool
[−]
Returns whether Value
s of type src
can be transformed to type dst
.
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Self
[−]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[−]
Performs copy-assignment from source
. Read more
impl Drop for Value
[src]
impl Debug for Value
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[−]
Formats the value using the given formatter.
impl<'a, T: ?Sized + SetValueOptional> From<Option<&'a T>> for Value
[src]
impl<'a, T: ?Sized + SetValue> From<&'a T> for Value
[src]
impl<T> From<TypedValue<T>> for Value
[src]
fn from(value: TypedValue<T>) -> Self
[−]
Performs the conversion.
impl Uninitialized for Value
[src]
unsafe fn uninitialized() -> Value
[−]
Returns an uninitialized value.
impl<'a> ToGlibPtr<'a, *const GValue> for Value
[src]
type Storage = &'a Value
fn to_glib_none(&'a self) -> Stash<'a, *const GValue, Self>
[−]
Transfer: none. Read more
fn to_glib_container(&'a self) -> Stash<'a, P, Self>
[−]
Transfer: container. Read more
fn to_glib_full(&self) -> P
[−]
Transfer: full. Read more
impl<'a> ToGlibPtrMut<'a, *mut GValue> for Value
[src]
type Storage = &'a mut Value
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GValue, Self>
[−]
Transfer: none. Read more