#[repr(transparent)]
pub struct VariantTy { /* private fields */ }
Expand description

Describes Variant types.

This is a borrowed counterpart of VariantType. Essentially it’s a str statically guaranteed to be a valid type string.

Implementations

bool.

u8.

i16.

u16.

i32.

u32.

i64.

u64.

f64.

&str.

DBus object path.

Type signature.

Variant.

Handle.

Unit, i.e. ().

An indefinite type that is a supertype of every type (including itself).

Any basic type.

Any maybe type, i.e. Option<T>.

Any array type, i.e. [T].

Any tuple type, i.e. (T), (T, T), etc.

source

pub const DICT_ENTRY: &'static VariantTy

Any dict entry type, i.e. DictEntry<K, V>.

Any dictionary type, i.e. HashMap<K, V>, BTreeMap<K, V>.

String array, i.e. [&str].

Object path array, i.e. [&str].

Byte string, i.e. [u8].

Byte string array, i.e. [[u8]].

Variant dictionary, i.e. HashMap<String, Variant>, BTreeMap<String, Variant>, etc.

Tries to create a &VariantTy from a string slice.

Returns Ok if the string is a valid type string, Err otherwise.

Converts a type string into &VariantTy without any checks.

Safety

The caller is responsible for passing in only a valid variant type string.

Converts to a string slice.

Check if this variant type is a definite type.

Check if this variant type is a container type.

Check if this variant type is a basic type.

Check if this variant type is a maybe type.

Check if this variant type is an array type.

Check if this variant type is a tuple type.

source

pub fn is_dict_entry(&self) -> bool

Check if this variant type is a dict entry type.

Check if this variant type is a variant.

Check if this variant type is a subtype of another.

Return the element type of this variant type.

Panics

This function panics if not called with an array or maybe type.

Iterate over the types of this variant type.

Panics

This function panics if not called with a tuple or dictionary entry type.

Return the first type of this variant type.

Panics

This function panics if not called with a tuple or dictionary entry type.

Return the next type of this variant type.

Return the number of items in this variant type.

Return the key type of this variant type.

Panics

This function panics if not called with a dictionary entry type.

Return the value type of this variant type.

Panics

This function panics if not called with a dictionary entry type.

Trait Implementations

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

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

Immutably borrows from an owned value. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returns the type identifier of Self.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a SendValue clone of self.

Converts the given value to a String. Read more