Struct gdk_pixbuf::TypedValue [−][src]
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
impl<'a, T> TypedValue<T> where
T: FromValueOptional<'a> + SetValue, [src]
T: FromValueOptional<'a> + SetValue,
pub fn get(&'a self) -> Option<T>[src]
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]
T: FromValue<'a>,
Returns the value.
This method is only available for types that don’t support a None
value.
pub fn set<U>(&mut self, value: Option<&U>) where
T: Borrow<U>,
U: SetValueOptional + ?Sized, [src]
T: Borrow<U>,
U: SetValueOptional + ?Sized,
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]
T: SetValueOptional,
Sets the value to None.
This method is only available for types that support a None value.
pub fn set_some<U>(&mut self, value: &U) where
T: Borrow<U>,
U: SetValue + ?Sized, [src]
T: Borrow<U>,
U: SetValue + ?Sized,
Sets the value.
impl<'a, T> TypedValue<T> where
T: FromValueOptional<'a> + SetValue + Send, [src]
T: FromValueOptional<'a> + SetValue + Send,
pub fn into_send_value(self) -> SendValue[src]
Methods from Deref<Target = Value>
pub fn downcast_ref<'a, T>(&self) -> Option<&TypedValue<T>> where
T: FromValueOptional<'a> + SetValue, [src]
T: FromValueOptional<'a> + SetValue,
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>(&'a self) -> Option<T> where
T: FromValueOptional<'a>, [src]
T: FromValueOptional<'a>,
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>(&self) -> bool where
T: FromValueOptional<'a> + SetValue, [src]
T: FromValueOptional<'a> + SetValue,
Returns true if the type of the value corresponds to T
or is a sub-type of T.
pub fn type_(&self) -> Type[src]
Returns the type of the value.
Trait Implementations
impl<T> Clone for TypedValue<T> where
T: Clone, [src]
T: Clone,
pub fn clone(&self) -> TypedValue<T>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<T> Debug for TypedValue<T>[src]
impl<T> Deref for TypedValue<T>[src]
impl<'a, T> From<&'a T> for TypedValue<T> where
T: FromValueOptional<'a> + SetValue, [src]
T: FromValueOptional<'a> + SetValue,
pub fn from(value: &'a T) -> TypedValue<T>[src]
impl<'a> From<&'a str> for TypedValue<String>[src]
pub fn from(value: &'a str) -> TypedValue<String>[src]
impl<'a, T> From<Option<&'a T>> for TypedValue<T> where
T: FromValueOptional<'a> + SetValueOptional, [src]
T: FromValueOptional<'a> + SetValueOptional,
pub fn from(value: Option<&'a T>) -> TypedValue<T>[src]
impl<'a> From<Option<&'a str>> for TypedValue<String>[src]
impl<'a> From<TypedValue<&'a str>> for TypedValue<String>[src]
pub fn from(value: TypedValue<&str>) -> TypedValue<String>[src]
impl<'a> From<TypedValue<String>> for TypedValue<&'a str>[src]
pub fn from(value: TypedValue<String>) -> TypedValue<&'a str>[src]
impl<T> From<TypedValue<T>> for Value[src]
pub fn from(value: TypedValue<T>) -> Value[src]
impl<'a, T> ToGlibPtrMut<'a, *mut GValue> for TypedValue<T> where
T: 'a, [src]
T: 'a,
type Storage = &'a mut TypedValue<T>
pub fn to_glib_none_mut(
&'a mut self
) -> StashMut<'a, *mut GValue, TypedValue<T>>[src]
&'a mut self
) -> StashMut<'a, *mut GValue, TypedValue<T>>
Auto Trait Implementations
impl<T> RefUnwindSafe for TypedValue<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for TypedValue<T>
impl<T> !Sync for TypedValue<T>
impl<T> Unpin for TypedValue<T>
impl<T> UnwindSafe for TypedValue<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,