# Struct glib::VariantTy [−] [src]

    pub struct VariantTy { /* fields omitted */ }

Describes `Variant` types.

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

## Methods

### `impl VariantTy`
[src]

#### `pub fn new(type_string: &str) -> Result<&VariantTy, ()>`
[src]

Tries to create a `&VariantTy` from a string slice.

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

#### `pub unsafe fn from_str_unchecked(type_string: &str) -> &VariantTy`
[src]

Converts a type string into `&VariantTy` without any checks.

#### `pub fn to_str(&self) -> &str`
[src]

Converts to a string slice.

## Trait Implementations

### `impl Borrow<VariantTy> for VariantType`
[src]

#### `fn borrow(&self) -> &VariantTy`
[src]

Immutably borrows from an owned value. Read more

### `impl Debug for VariantTy`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl PartialEq for VariantTy`
[src]

#### `fn eq(&self, __arg_0: &VariantTy) -> bool`
[src]

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

#### `fn ne(&self, __arg_0: &VariantTy) -> bool`
[src]

This method tests for `!=`.

### `impl Eq for VariantTy`
[src]

### `impl Hash for VariantTy`
[src]

#### `fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`
[src]

Feeds this value into the given [`Hasher`]. Read more

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,`
1.3.0
[src]

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

### `impl Sync for VariantTy`
[src]

### `impl Display for VariantTy`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl<'a> Into<Cow<'a, VariantTy>> for &'a VariantTy`
[src]

#### `fn into(self) -> Cow<'a, VariantTy>`
[src]

Performs the conversion.

### `impl ToOwned for VariantTy`
[src]

#### `type Owned = VariantType`

#### `fn to_owned(&self) -> VariantType`
[src]

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

#### `fn clone_into(&self, target: &mut Self::Owned)`
[src]

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

recently added

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

### `impl<'a, 'b> PartialEq<VariantTy> for VariantType`
[src]

#### `fn eq(&self, other: &VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<VariantType> for VariantTy`
[src]

#### `fn eq(&self, other: &VariantType) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<&'a VariantTy> for VariantType`
[src]

#### `fn eq(&self, other: &&'a VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<VariantType> for &'a VariantTy`
[src]

#### `fn eq(&self, other: &VariantType) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<Cow<'b, VariantTy>> for &'a VariantTy`
[src]

#### `fn eq(&self, other: &Cow<'b, VariantTy>) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<&'a VariantTy> for Cow<'b, VariantTy>`
[src]

#### `fn eq(&self, other: &&'a VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<str> for VariantTy`
[src]

#### `fn eq(&self, other: &str) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<VariantTy> for str`
[src]

#### `fn eq(&self, other: &VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<&'a str> for VariantTy`
[src]

#### `fn eq(&self, other: &&'a str) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<VariantTy> for &'a str`
[src]

#### `fn eq(&self, other: &VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<str> for &'a VariantTy`
[src]

#### `fn eq(&self, other: &str) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<&'a VariantTy> for str`
[src]

#### `fn eq(&self, other: &&'a VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<String> for VariantTy`
[src]

#### `fn eq(&self, other: &String) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<VariantTy> for String`
[src]

#### `fn eq(&self, other: &VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<String> for &'a VariantTy`
[src]

#### `fn eq(&self, other: &String) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl<'a, 'b> PartialEq<&'a VariantTy> for String`
[src]

#### `fn eq(&self, other: &&'a VariantTy) -> bool`
[src]

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

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
↑
  Move up in search results
↓
  Move down in search results
↹
  Switch tab
⏎
  Go to active search result
+ / -
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)