pub struct VariantType { /* private fields */ }
Expand description

Describes Variant types.

The Variant type system (based on the D-Bus one) describes types with “type strings”. VariantType is an owned immutable type string (you can think of it as a Box<str> statically guaranteed to be a valid type string), &VariantTy is a borrowed one (like &str).

Implementations

Tries to create a VariantType from a string slice.

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

Tries to create a VariantType from an owned string.

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

Methods from Deref<Target = VariantTy>

pub const DICT_ENTRY: &'static VariantTy

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.

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.

Return the first type of this variant type.

Panics

This function panics if not called with an array or dictionary 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 an dictionary type.

Return the value type of this variant type.

Panics

This function panics if not called with an dictionary type.

Trait Implementations

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Performs the conversion.

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 !=.

Returns the type identifier of Self.

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

Performs the conversion.

Performs the conversion.

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

Returns a SendValue clone of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.