---
name: "Glib::VariantType"
section: "3pm"
platform: "linux"
package: "glib-perl"
version: "1.329.4-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Glib::VariantType"
---

# Glib::VariantType(3pm)

Utilities for dealing with the GVariant type system

## NAME

Glib::VariantType -  Utilities for dealing with the GVariant type system

## HIERARCHY

```
  Glib::Boxed
  +----Glib::VariantType
```

## METHODS

### varianttype = Glib::VariantType-\>new ($type\_string)

- •

  `$type_string` (string)

### varianttype = Glib::VariantType-\>new\_array ($element)

- •

  `$element` (Glib::VariantType)

### varianttype = Glib::VariantType-\>new\_dict\_entry ($key, $value)

- •

  `$key` (Glib::VariantType)

- •

  `$value` (Glib::VariantType)

### varianttype = Glib::VariantType-\>new\_maybe ($element)

- •

  `$element` (Glib::VariantType)

### varianttype = Glib::VariantType-\>new\_tuple ($items)

- •

  `$items` (scalar)

### varianttype = $type-\>element

### boolean = $type1-\>equal ($type2)

- •

  `$type2` (Glib::VariantType)

### varianttype = $type-\>first

### integer = $type-\>hash

### boolean = $type-\>is\_array

### boolean = $type-\>is\_basic

### boolean = $type-\>is\_container

### boolean = $type-\>is\_definite

### boolean = $type-\>is\_dict\_entry

### boolean = $type-\>is\_maybe

### boolean = $type-\>is\_subtype\_of ($supertype)

- •

  `$supertype` (Glib::VariantType)

### boolean = $type-\>is\_tuple

### boolean = $type-\>is\_variant

### varianttype = $type-\>key

### unsigned = $type-\>n\_items

### varianttype = $type-\>next

### scalar = $type-\>get\_string

### boolean = Glib::VariantType::string\_is\_valid ($type\_string)

- •

  `$type_string` (string)

### (type\_string, rest) = Glib::VariantType::string\_scan ($string)

Scans the start of `$string` for a complete type string and extracts it.  If no type string can be found, an exception is thrown.

### varianttype = $type-\>value

## SEE ALSO

Glib, Glib::Boxed, Glib::Variant

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Glib for a full notice.
