Struct SendValue

Source
#[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

Source

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.

Source

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>§

Source

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.

Source

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.

Source

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.

Source

pub fn type_(&self) -> Type

Returns the type of the value.

Trait Implementations§

Source§

impl Clone for SendValue

Source§

fn clone(&self) -> SendValue

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SendValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, T: ?Sized + SetValue + Send> From<&'a T> for SendValue

Source§

fn from(value: &'a T) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: ?Sized + SetValueOptional + Send> From<Option<&'a T>> for SendValue

Source§

fn from(value: Option<&'a T>) -> Self

Converts to this type from the input type.
Source§

impl From<SendValue> for Value

Source§

fn from(value: SendValue) -> Self

Converts to this type from the input type.
Source§

impl<T: Send> From<TypedValue<T>> for SendValue

Source§

fn from(value: TypedValue<T>) -> Self

Converts to this type from the input type.
Source§

impl FromGlibContainerAsVec<*mut GValue, *const *mut GValue> for SendValue

Source§

impl FromGlibContainerAsVec<*mut GValue, *mut *mut GValue> for SendValue

Source§

impl FromGlibPtrArrayContainerAsVec<*mut GValue, *const *mut GValue> for SendValue

Source§

impl FromGlibPtrArrayContainerAsVec<*mut GValue, *mut *mut GValue> for SendValue

Source§

impl FromGlibPtrFull<*mut GValue> for SendValue

Source§

unsafe fn from_glib_full(ptr: *mut GValue) -> Self

Source§

impl FromGlibPtrNone<*const GValue> for SendValue

Source§

unsafe fn from_glib_none(ptr: *const GValue) -> Self

Source§

impl FromGlibPtrNone<*mut GValue> for SendValue

Source§

unsafe fn from_glib_none(ptr: *mut GValue) -> Self

Source§

impl ToSendValue for SendValue

Source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
Source§

impl ToValue for SendValue

Source§

fn to_value(&self) -> Value

Returns a Value clone of self.
Source§

fn to_value_type(&self) -> Type

Returns the type identifer of self. Read more
Source§

impl Deref for SendValue

Source§

type Target = Value

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Value

Dereferences the value.
Source§

impl Send for SendValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.