Struct gdk_pixbuf::Value [−][src]
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.
Value
does not implement the Send
trait, but SendValue
can be
used instead.
See the module documentation for more details.
Implementations
impl Value
[src]
pub fn from_type(type_: Type) -> Value
[src]
Creates a new Value
that is initialized with type_
pub fn downcast<'a, T>(self) -> Result<TypedValue<T>, Value> where
T: FromValueOptional<'a> + SetValue,
[src]
T: FromValueOptional<'a> + SetValue,
Tries to downcast to a TypedValue
.
Returns Ok(TypedValue<T>)
if the value carries a type corresponding
to T
and Err(self)
otherwise.
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.
pub fn type_transformable(src: Type, dst: Type) -> bool
[src]
Returns whether Value
s of type src
can be transformed to type dst
.
pub fn try_into_send_value<'a, T>(self) -> Result<SendValue, Value> where
T: Send + FromValueOptional<'a> + SetValue,
[src]
T: Send + FromValueOptional<'a> + SetValue,
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl Drop for Value
[src]
impl<'a, T> From<&'a T> for Value where
T: SetValue + ?Sized,
[src]
T: SetValue + ?Sized,
impl<'a, T> From<Option<&'a T>> for Value where
T: SetValueOptional + ?Sized,
[src]
T: SetValueOptional + ?Sized,
impl From<SendValue> for Value
[src]
impl<T> From<TypedValue<T>> for Value
[src]
pub fn from(value: TypedValue<T>) -> Value
[src]
impl FromGlibContainerAsVec<*mut GValue, *const *mut GValue> for Value
[src]
pub unsafe fn from_glib_none_num_as_vec(
ptr: *const *mut GValue,
num: usize
) -> Vec<Value, Global>
[src]
ptr: *const *mut GValue,
num: usize
) -> Vec<Value, Global>
pub unsafe fn from_glib_container_num_as_vec(
*const *mut GValue,
usize
) -> Vec<Value, Global>
[src]
*const *mut GValue,
usize
) -> Vec<Value, Global>
pub unsafe fn from_glib_full_num_as_vec(
*const *mut GValue,
usize
) -> Vec<Value, Global>
[src]
*const *mut GValue,
usize
) -> Vec<Value, Global>
impl FromGlibContainerAsVec<*mut GValue, *mut *mut GValue> for Value
[src]
pub unsafe fn from_glib_none_num_as_vec(
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
[src]
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
pub unsafe fn from_glib_container_num_as_vec(
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
[src]
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
pub unsafe fn from_glib_full_num_as_vec(
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
[src]
ptr: *mut *mut GValue,
num: usize
) -> Vec<Value, Global>
impl FromGlibPtrArrayContainerAsVec<*mut GValue, *const *mut GValue> for Value
[src]
pub unsafe fn from_glib_none_as_vec(
ptr: *const *mut GValue
) -> Vec<Value, Global>
[src]
ptr: *const *mut GValue
) -> Vec<Value, Global>
pub unsafe fn from_glib_container_as_vec(
*const *mut GValue
) -> Vec<Value, Global>
[src]
*const *mut GValue
) -> Vec<Value, Global>
pub unsafe fn from_glib_full_as_vec(*const *mut GValue) -> Vec<Value, Global>
[src]
impl FromGlibPtrArrayContainerAsVec<*mut GValue, *mut *mut GValue> for Value
[src]
pub unsafe fn from_glib_none_as_vec(ptr: *mut *mut GValue) -> Vec<Value, Global>
[src]
pub unsafe fn from_glib_container_as_vec(
ptr: *mut *mut GValue
) -> Vec<Value, Global>
[src]
ptr: *mut *mut GValue
) -> Vec<Value, Global>
pub unsafe fn from_glib_full_as_vec(ptr: *mut *mut GValue) -> Vec<Value, Global>
[src]
impl FromGlibPtrFull<*mut GValue> for Value
[src]
pub unsafe fn from_glib_full(ptr: *mut GValue) -> Value
[src]
impl FromGlibPtrNone<*const GValue> for Value
[src]
pub unsafe fn from_glib_none(ptr: *const GValue) -> Value
[src]
impl FromGlibPtrNone<*mut GValue> for Value
[src]
pub unsafe fn from_glib_none(ptr: *mut GValue) -> Value
[src]
impl<'a> ToGlibContainerFromSlice<'a, *const GValue> for &'a Value
[src]
type Storage = &'a [&'a Value]
pub fn to_glib_none_from_slice(
t: &'a [&'a Value]
) -> (*const GValue, &'a [&'a Value])
[src]
t: &'a [&'a Value]
) -> (*const GValue, &'a [&'a Value])
pub fn to_glib_container_from_slice(
&'a [&'a Value]
) -> (*const GValue, &'a [&'a Value])
[src]
&'a [&'a Value]
) -> (*const GValue, &'a [&'a Value])
pub fn to_glib_full_from_slice(&[&'a Value]) -> *const GValue
[src]
impl<'a> ToGlibContainerFromSlice<'a, *mut GValue> for &'a Value
[src]
type Storage = &'a [&'a Value]
pub fn to_glib_none_from_slice(
t: &'a [&'a Value]
) -> (*mut GValue, &'a [&'a Value])
[src]
t: &'a [&'a Value]
) -> (*mut GValue, &'a [&'a Value])
pub fn to_glib_container_from_slice(
t: &'a [&'a Value]
) -> (*mut GValue, &'a [&'a Value])
[src]
t: &'a [&'a Value]
) -> (*mut GValue, &'a [&'a Value])
pub fn to_glib_full_from_slice(t: &[&'a Value]) -> *mut GValue
[src]
impl<'a> ToGlibPtr<'a, *const GValue> for Value
[src]
type Storage = &'a Value
pub fn to_glib_none(&'a self) -> Stash<'a, *const GValue, Value>
[src]
pub fn to_glib_container(&'a self) -> Stash<'a, P, Self>
[src]
pub fn to_glib_full(&self) -> P
[src]
impl<'a> ToGlibPtrMut<'a, *mut GValue> for Value
[src]
type Storage = &'a mut Value
pub fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GValue, Value>
[src]
impl ToValue for Value
[src]
impl Uninitialized for Value
[src]
pub unsafe fn uninitialized() -> Value
[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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>,