Struct glib::value::TypedValue [−][src]
#[repr(C)]pub struct TypedValue<T>(_, _);
A statically typed Value
.
It dereferences to Value
and can be used everywhere Value
references are
accepted.
See the module documentation for more details.
Methods
impl<'a, T: FromValueOptional<'a> + SetValue> TypedValue<T>
[src]
impl<'a, T: FromValueOptional<'a> + SetValue> TypedValue<T>
pub fn get(&'a self) -> Option<T>
[src]
pub fn get(&'a self) -> Option<T>
Returns the value.
Types that don't support a None
value always return Some
. See
get_some
.
pub fn get_some(&'a self) -> T where
T: FromValue<'a>,
[src]
pub fn get_some(&'a self) -> T where
T: FromValue<'a>,
Returns the value.
This method is only available for types that don't support a None
value.
pub fn set<U: ?Sized + SetValueOptional>(&mut self, value: Option<&U>) where
T: Borrow<U>,
[src]
pub fn set<U: ?Sized + SetValueOptional>(&mut self, value: Option<&U>) where
T: Borrow<U>,
Sets the value.
This method is only available for types that support a None
value.
pub fn set_none(&mut self) where
T: SetValueOptional,
[src]
pub fn set_none(&mut self) where
T: SetValueOptional,
Sets the value to None
.
This method is only available for types that support a None
value.
pub fn set_some<U: ?Sized + SetValue>(&mut self, value: &U) where
T: Borrow<U>,
[src]
pub fn set_some<U: ?Sized + SetValue>(&mut self, value: &U) where
T: Borrow<U>,
Sets the value.
impl<'a, T: FromValueOptional<'a> + SetValue + Send> TypedValue<T>
[src]
impl<'a, T: FromValueOptional<'a> + SetValue + Send> TypedValue<T>
pub fn into_send_value(self) -> SendValue
[src]
pub fn into_send_value(self) -> SendValue
Methods from Deref<Target = Value>
pub fn downcast_ref<'a, T: FromValueOptional<'a> + SetValue>(
&self
) -> Option<&TypedValue<T>>
[src]
pub fn downcast_ref<'a, T: FromValueOptional<'a> + SetValue>(
&self
) -> Option<&TypedValue<T>>
Tries to downcast to a &TypedValue
.
Returns Some(&TypedValue<T>)
if the value carries a type corresponding
to T
and None
otherwise.
pub fn get<'a, T: FromValueOptional<'a>>(&'a self) -> Option<T>
[src]
pub 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.
pub fn is<'a, T: FromValueOptional<'a> + SetValue>(&self) -> bool
[src]
pub fn is<'a, T: FromValueOptional<'a> + SetValue>(&self) -> bool
Returns true
if the type of the value corresponds to T
or is a sub-type of T
.
pub fn type_(&self) -> Type
[src]
pub fn type_(&self) -> Type
Returns the type of the value.
Trait Implementations
impl<T> From<TypedValue<T>> for Value
[src]
impl<T> From<TypedValue<T>> for Value
fn from(value: TypedValue<T>) -> Self
[src]
fn from(value: TypedValue<T>) -> Self
Performs the conversion.
impl<T: Clone> Clone for TypedValue<T>
[src]
impl<T: Clone> Clone for TypedValue<T>
fn clone(&self) -> TypedValue<T>
[src]
fn clone(&self) -> TypedValue<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Debug for TypedValue<T>
[src]
impl<T> Debug for TypedValue<T>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> Deref for TypedValue<T>
[src]
impl<T> Deref for TypedValue<T>
type Target = Value
The resulting type after dereferencing.
fn deref(&self) -> &Value
[src]
fn deref(&self) -> &Value
Dereferences the value.
impl<'a, T: FromValueOptional<'a> + SetValueOptional> From<Option<&'a T>> for TypedValue<T>
[src]
impl<'a, T: FromValueOptional<'a> + SetValueOptional> From<Option<&'a T>> for TypedValue<T>
impl<'a, T: FromValueOptional<'a> + SetValue> From<&'a T> for TypedValue<T>
[src]
impl<'a, T: FromValueOptional<'a> + SetValue> From<&'a T> for TypedValue<T>
impl<'a> From<Option<&'a str>> for TypedValue<String>
[src]
impl<'a> From<Option<&'a str>> for TypedValue<String>
impl<'a> From<&'a str> for TypedValue<String>
[src]
impl<'a> From<&'a str> for TypedValue<String>
impl<'a> From<TypedValue<&'a str>> for TypedValue<String>
[src]
impl<'a> From<TypedValue<&'a str>> for TypedValue<String>
fn from(value: TypedValue<&str>) -> Self
[src]
fn from(value: TypedValue<&str>) -> Self
Performs the conversion.
impl<'a> From<TypedValue<String>> for TypedValue<&'a str>
[src]
impl<'a> From<TypedValue<String>> for TypedValue<&'a str>
fn from(value: TypedValue<String>) -> Self
[src]
fn from(value: TypedValue<String>) -> Self
Performs the conversion.
impl<'a, T: 'a> ToGlibPtrMut<'a, *mut GValue> for TypedValue<T>
[src]
impl<'a, T: 'a> ToGlibPtrMut<'a, *mut GValue> for TypedValue<T>
type Storage = &'a mut TypedValue<T>
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GValue, Self>
[src]
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GValue, Self>
Transfer: none. Read more
impl<T: Send> From<TypedValue<T>> for SendValue
[src]
impl<T: Send> From<TypedValue<T>> for SendValue
fn from(value: TypedValue<T>) -> Self
[src]
fn from(value: TypedValue<T>) -> Self
Performs the conversion.
Auto Trait Implementations
impl<T> !Send for TypedValue<T>
impl<T> !Send for TypedValue<T>
impl<T> !Sync for TypedValue<T>
impl<T> !Sync for TypedValue<T>