#[repr(C)]pub struct SendValue(/* private fields */);
Expand description
A version of Value
for storing Send
types, that implements Send
itself.
See the module documentation for more details.
Implementations§
Source§impl SendValue
impl SendValue
Sourcepub fn downcast<'a, T: FromValueOptional<'a> + SetValue + Send>(
self,
) -> Result<TypedValue<T>, Self>
pub fn downcast<'a, T: FromValueOptional<'a> + SetValue + Send>( 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.
Sourcepub fn downcast_ref<'a, T: FromValueOptional<'a> + SetValue>(
&self,
) -> Option<&TypedValue<T>>
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.
Methods from Deref<Target = Value>§
Sourcepub fn downcast_ref<'a, T: FromValueOptional<'a> + SetValue>(
&self,
) -> Option<&TypedValue<T>>
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.
Sourcepub fn get<'a, T: FromValueOptional<'a>>(&'a self) -> Option<T>
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.
Sourcepub fn is<'a, T: FromValueOptional<'a> + SetValue>(&self) -> bool
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
.
Trait Implementations§
Source§impl<T: Send> From<TypedValue<T>> for SendValue
impl<T: Send> From<TypedValue<T>> for SendValue
Source§fn from(value: TypedValue<T>) -> Self
fn from(value: TypedValue<T>) -> Self
Source§impl FromGlibPtrFull<*mut GValue> for SendValue
impl FromGlibPtrFull<*mut GValue> for SendValue
unsafe fn from_glib_full(ptr: *mut GValue) -> Self
Source§impl FromGlibPtrNone<*const GValue> for SendValue
impl FromGlibPtrNone<*const GValue> for SendValue
unsafe fn from_glib_none(ptr: *const GValue) -> Self
Source§impl FromGlibPtrNone<*mut GValue> for SendValue
impl FromGlibPtrNone<*mut GValue> for SendValue
unsafe fn from_glib_none(ptr: *mut GValue) -> Self
Source§impl ToSendValue for SendValue
impl ToSendValue for SendValue
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.