Struct glib::variant::Variant

source ·
pub struct Variant { /* private fields */ }
Expand description

A generic immutable value capable of carrying various types.

See the module documentation for more details.

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

source§

impl Variant

source

pub fn as_ptr(&self) -> *mut GVariant

Return the inner pointer to the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const *const GVariant) -> &'a Self

Borrows the underlying C value.

source§

impl Variant

source

pub fn type_(&self) -> &VariantTy

Returns the type of the value.

source

pub fn is<T: StaticVariantType>(&self) -> bool

Returns true if the type of the value corresponds to T.

source

pub fn is_type(&self, type_: &VariantTy) -> bool

Returns true if the type of the value corresponds to type_.

This is equivalent to self.type_().is_subtype_of(type_).

source

pub fn classify(&self) -> VariantClass

Returns the classification of the variant.

source

pub fn get<T: FromVariant>(&self) -> Option<T>

Tries to extract a value of type T.

Returns Some if T matches the variant’s type.

source

pub fn try_get<T: FromVariant>(&self) -> Result<T, VariantTypeMismatchError>

Tries to extract a value of type T.

source

pub fn from_variant(value: &Variant) -> Self

Boxes value.

source

pub fn as_variant(&self) -> Option<Variant>

Unboxes self.

Returns Some if self contains a Variant.

source

pub fn child_value(&self, index: usize) -> Variant

Reads a child item out of a container Variant instance.

§Panics
  • if self is not a container type.
  • if given index is larger than number of children.
source

pub fn try_child_value(&self, index: usize) -> Option<Variant>

Try to read a child item out of a container Variant instance.

It returns None if self is not a container type or if the given index is larger than number of children.

source

pub fn try_child_get<T: StaticVariantType + FromVariant>( &self, index: usize, ) -> Result<Option<T>, VariantTypeMismatchError>

Try to read a child item out of a container Variant instance.

It returns Ok(None) if self is not a container type or if the given index is larger than number of children. An error is thrown if the type does not match.

source

pub fn child_get<T: StaticVariantType + FromVariant>(&self, index: usize) -> T

Read a child item out of a container Variant instance.

§Panics
  • if self is not a container type.
  • if given index is larger than number of children.
  • if the expected variant type does not match
source

pub fn str(&self) -> Option<&str>

Tries to extract a &str.

Returns Some if the variant has a string type (s, o or g type strings).

source

pub fn fixed_array<T: FixedSizeVariantType>( &self, ) -> Result<&[T], VariantTypeMismatchError>

Tries to extract a &[T] from a variant of array type with a suitable element type.

Returns an error if the type is wrong.

source

pub fn array_from_iter<T: StaticVariantType>( children: impl IntoIterator<Item = Variant>, ) -> Self

Creates a new Variant array from children.

§Panics

This function panics if not all variants are of type T.

source

pub fn array_from_iter_with_type( type_: &VariantTy, children: impl IntoIterator<Item = impl AsRef<Variant>>, ) -> Self

Creates a new Variant array from children with the specified type.

§Panics

This function panics if not all variants are of type type_.

source

pub fn array_from_fixed_array<T: FixedSizeVariantType>(array: &[T]) -> Self

Creates a new Variant array from a fixed array.

source

pub fn tuple_from_iter( children: impl IntoIterator<Item = impl AsRef<Variant>>, ) -> Self

Creates a new Variant tuple from children.

source

pub fn from_dict_entry(key: &Variant, value: &Variant) -> Self

Creates a new dictionary entry Variant.

DictEntry should be preferred over this when the types are known statically.

source

pub fn from_maybe<T: StaticVariantType>(child: Option<&Variant>) -> Self

Creates a new maybe Variant.

source

pub fn from_some(child: &Variant) -> Self

Creates a new maybe Variant from a child.

source

pub fn from_none(type_: &VariantTy) -> Self

Creates a new maybe Variant with Nothing.

source

pub fn as_maybe(&self) -> Option<Variant>

Extract the value of a maybe Variant.

Returns the child value, or None if the value is Nothing.

§Panics

Panics if the variant is not maybe-typed.

source

pub fn print(&self, type_annotate: bool) -> GString

Pretty-print the contents of this variant in a human-readable form.

A variant can be recreated from this output via Variant::parse.

source

pub fn parse(type_: Option<&VariantTy>, text: &str) -> Result<Self, Error>

Parses a GVariant from the text representation produced by print().

source

pub fn from_bytes<T: StaticVariantType>(bytes: &Bytes) -> Self

Constructs a new serialized-mode GVariant instance.

source

pub unsafe fn from_bytes_trusted<T: StaticVariantType>(bytes: &Bytes) -> Self

Constructs a new serialized-mode GVariant instance.

This is the same as from_bytes, except that checks on the passed data are skipped.

You should not use this function on data from external sources.

§Safety

Since the data is not validated, this is potentially dangerous if called on bytes which are not guaranteed to have come from serialising another Variant. The caller is responsible for ensuring bad data is not passed in.

source

pub fn from_data<T: StaticVariantType, A: AsRef<[u8]>>(data: A) -> Self

Constructs a new serialized-mode GVariant instance.

source

pub unsafe fn from_data_trusted<T: StaticVariantType, A: AsRef<[u8]>>( data: A, ) -> Self

Constructs a new serialized-mode GVariant instance.

This is the same as from_data, except that checks on the passed data are skipped.

You should not use this function on data from external sources.

§Safety

Since the data is not validated, this is potentially dangerous if called on bytes which are not guaranteed to have come from serialising another Variant. The caller is responsible for ensuring bad data is not passed in.

source

pub fn from_bytes_with_type(bytes: &Bytes, type_: &VariantTy) -> Self

Constructs a new serialized-mode GVariant instance with a given type.

source

pub unsafe fn from_bytes_with_type_trusted( bytes: &Bytes, type_: &VariantTy, ) -> Self

Constructs a new serialized-mode GVariant instance with a given type.

This is the same as from_bytes, except that checks on the passed data are skipped.

You should not use this function on data from external sources.

§Safety

Since the data is not validated, this is potentially dangerous if called on bytes which are not guaranteed to have come from serialising another Variant. The caller is responsible for ensuring bad data is not passed in.

source

pub fn from_data_with_type<A: AsRef<[u8]>>(data: A, type_: &VariantTy) -> Self

Constructs a new serialized-mode GVariant instance with a given type.

source

pub unsafe fn from_data_with_type_trusted<A: AsRef<[u8]>>( data: A, type_: &VariantTy, ) -> Self

Constructs a new serialized-mode GVariant instance with a given type.

This is the same as from_data, except that checks on the passed data are skipped.

You should not use this function on data from external sources.

§Safety

Since the data is not validated, this is potentially dangerous if called on bytes which are not guaranteed to have come from serialising another Variant. The caller is responsible for ensuring bad data is not passed in.

source

pub fn data_as_bytes(&self) -> Bytes

Returns the serialized form of a GVariant instance.

source

pub fn data(&self) -> &[u8]

Returns the serialized form of a GVariant instance.

source

pub fn size(&self) -> usize

Returns the size of serialized form of a GVariant instance.

source

pub fn store(&self, data: &mut [u8]) -> Result<usize, BoolError>

Stores the serialized form of a GVariant instance into the given slice.

The slice needs to be big enough.

source

pub fn normal_form(&self) -> Self

Returns a copy of the variant in normal form.

source

pub fn byteswap(&self) -> Self

Returns a copy of the variant in the opposite endianness.

source

pub fn n_children(&self) -> usize

Determines the number of children in a container GVariant instance.

source

pub fn iter(&self) -> VariantIter

Create an iterator over items in the variant.

Note that this heap allocates a variant for each element, which can be particularly expensive for large arrays.

source

pub fn array_iter_str( &self, ) -> Result<VariantStrIter<'_>, VariantTypeMismatchError>

Create an iterator over borrowed strings from a GVariant of type as (array of string).

This will fail if the variant is not an array of with the expected child type.

A benefit of this API over Self::iter() is that it minimizes allocation, and provides strongly typed access.

let strs = &["foo", "bar"];
let strs_variant: glib::Variant = strs.to_variant();
for s in strs_variant.array_iter_str()? {
    println!("{}", s);
}
source

pub fn is_container(&self) -> bool

Return whether this Variant is a container type.

source

pub fn is_normal_form(&self) -> bool

Return whether this Variant is in normal form.

source

pub fn is_object_path(string: &str) -> bool

Return whether input string is a valid VariantClass::ObjectPath.

source

pub fn is_signature(string: &str) -> bool

Return whether input string is a valid VariantClass::Signature.

Trait Implementations§

source§

impl AsRef<Variant> for Variant

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Variant

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Variant

source§

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

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

impl Display for Variant

source§

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

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

impl<T: StaticVariantType + ToVariant> From<&[T]> for Variant

source§

fn from(s: &[T]) -> Self

Converts to this type from the input type.
source§

impl From<&OsStr> for Variant

source§

fn from(s: &OsStr) -> Self

Converts to this type from the input type.
source§

impl From<&Path> for Variant

source§

fn from(p: &Path) -> Self

Converts to this type from the input type.
source§

impl<'a, T: ?Sized + Into<Variant> + Clone> From<&'a T> for Variant

source§

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

Converts to this type from the input type.
source§

impl From<&str> for Variant

source§

fn from(s: &str) -> Self

Converts to this type from the input type.
source§

impl From<()> for Variant

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl<T0> From<(T0,)> for Variant
where T0: Into<Variant>,

source§

fn from(t: (T0,)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1> From<(T0, T1)> for Variant
where T0: Into<Variant>, T1: Into<Variant>,

source§

fn from(t: (T0, T1)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2> From<(T0, T1, T2)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>,

source§

fn from(t: (T0, T1, T2)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3> From<(T0, T1, T2, T3)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4> From<(T0, T1, T2, T3, T4)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5> From<(T0, T1, T2, T3, T4, T5)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6> From<(T0, T1, T2, T3, T4, T5, T6)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> From<(T0, T1, T2, T3, T4, T5, T6, T7)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>, T11: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>, T11: Into<Variant>, T12: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>, T11: Into<Variant>, T12: Into<Variant>, T13: Into<Variant>,

source§

fn from(t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>, T11: Into<Variant>, T12: Into<Variant>, T13: Into<Variant>, T14: Into<Variant>,

source§

fn from( t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), ) -> Self

Converts to this type from the input type.
source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> From<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> for Variant
where T0: Into<Variant>, T1: Into<Variant>, T2: Into<Variant>, T3: Into<Variant>, T4: Into<Variant>, T5: Into<Variant>, T6: Into<Variant>, T7: Into<Variant>, T8: Into<Variant>, T9: Into<Variant>, T10: Into<Variant>, T11: Into<Variant>, T12: Into<Variant>, T13: Into<Variant>, T14: Into<Variant>, T15: Into<Variant>,

source§

fn from( t: (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), ) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<BTreeMap<K, V>> for Variant

source§

fn from(m: BTreeMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<DictEntry<K, V>> for Variant

source§

fn from(e: DictEntry<K, V>) -> Self

Converts to this type from the input type.
source§

impl<A: AsRef<[T]>, T: FixedSizeVariantType> From<FixedSizeVariantArray<A, T>> for Variant

source§

fn from(a: FixedSizeVariantArray<A, T>) -> Self

Converts to this type from the input type.
source§

impl From<Handle> for Variant

source§

fn from(h: Handle) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<HashMap<K, V>> for Variant

source§

fn from(m: HashMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl From<ObjectPath> for Variant

source§

fn from(p: ObjectPath) -> Self

Converts to this type from the input type.
source§

impl<T: StaticVariantType + Into<Variant>> From<Option<T>> for Variant

source§

fn from(v: Option<T>) -> Self

Converts to this type from the input type.
source§

impl From<OsString> for Variant

source§

fn from(s: OsString) -> Self

Converts to this type from the input type.
source§

impl From<PathBuf> for Variant

source§

fn from(p: PathBuf) -> Self

Converts to this type from the input type.
source§

impl From<Signature> for Variant

source§

fn from(s: Signature) -> Self

Converts to this type from the input type.
source§

impl From<String> for Variant

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl From<Variant> for VariantDict

source§

fn from(other: Variant) -> Self

Converts to this type from the input type.
source§

impl From<VariantDict> for Variant

source§

fn from(d: VariantDict) -> Self

Converts to this type from the input type.
source§

impl<T: StaticVariantType + Into<Variant>> From<Vec<T>> for Variant

source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Variant

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Variant

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Variant

source§

fn from(v: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Variant

source§

fn from(v: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Variant

source§

fn from(v: i64) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Variant

source§

fn from(v: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Variant

source§

fn from(v: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Variant

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Variant

source§

fn from(v: u8) -> Self

Converts to this type from the input type.
source§

impl<T: Into<Variant> + StaticVariantType> FromIterator<T> for Variant

source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromStr for Variant

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl FromVariant for Variant

source§

fn from_variant(variant: &Variant) -> Option<Self>

Tries to extract a value. Read more
source§

impl HasParamSpec for Variant

§

type ParamSpec = ParamSpecVariant

§

type SetValue = Variant

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &'static str, _: &'static VariantTy) -> ParamSpecVariantBuilder<'static>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for Variant

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Variant

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Variant

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for Variant

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl StaticVariantType for Variant

source§

fn static_variant_type() -> Cow<'static, VariantTy>

Returns the VariantType corresponding to Self.
source§

impl ToVariant for Variant

source§

fn to_variant(&self) -> Variant

Returns a Variant clone of self.
source§

impl Eq for Variant

source§

impl Send for Variant

source§

impl Sync for Variant

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

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<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

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

§

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> ToSendValue for T
where T: Send + ToValue + ?Sized,

source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TransparentType for T

source§

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

§

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

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

§

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

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,