Struct glib::value::TypedValue

source ·
#[repr(C)]
pub struct TypedValue<T>(_, _);
Expand description

A statically typed Value.

It dereferences to Value and can be used everywhere Value references are accepted.

See the module documentation for more details.

Implementations

Returns the value.

Types that don’t support a None value always return Some. See get_some.

Returns the value.

This method is only available for types that don’t support a None value.

Sets the value.

This method is only available for types that support a None value.

Sets the value to None.

This method is only available for types that support a None value.

Sets the value.

Methods from Deref<Target = Value>

Tries to downcast to a &TypedValue.

Returns Some(&TypedValue<T>) if the value carries a type corresponding to T and None 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 or is a sub-type of T.

Returns the type of the value.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Transfer: none. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.