lib.gvariant: GVariant formatted string serialization functions

lib.gvariant.isGVariant

Type: isGVariant :: Any -> Bool

Check if a value is a GVariant value

v

Function argument

Located at lib/gvariant.nix:53 in <nixpkgs>.

lib.gvariant.mkValue

Type: mkValue :: Any -> gvariant

Returns the GVariant value that most closely matches the given Nix value. If no GVariant value can be found unambiguously then error is thrown.

v

Function argument

Located at lib/gvariant.nix:61 in <nixpkgs>.

lib.gvariant.mkArray

Type: mkArray :: [Any] -> gvariant

Returns the GVariant array from the given type of the elements and a Nix list.

elems

Function argument

Example

lib.gvariant.mkArray usage example

# Creating a string array
lib.gvariant.mkArray [ "a" "b" "c" ]

Located at lib/gvariant.nix:84 in <nixpkgs>.

lib.gvariant.mkEmptyArray

Type: mkEmptyArray :: gvariant.type -> gvariant

Returns the GVariant array from the given empty Nix list.

elemType

Function argument

Example

lib.gvariant.mkEmptyArray usage example

# Creating an empty string array
lib.gvariant.mkEmptyArray (lib.gvariant.type.string)

Located at lib/gvariant.nix:105 in <nixpkgs>.

lib.gvariant.mkVariant

Type: mkVariant :: Any -> gvariant

Returns the GVariant variant from the given Nix value. Variants are containers of different GVariant type.

elem

Function argument

Example

lib.gvariant.mkVariant usage example

lib.gvariant.mkArray [
  (lib.gvariant.mkVariant "a string")
  (lib.gvariant.mkVariant (lib.gvariant.mkInt32 1))
]

Located at lib/gvariant.nix:122 in <nixpkgs>.

lib.gvariant.mkDictionaryEntry

Type: mkDictionaryEntry :: String -> Any -> gvariant

Returns the GVariant dictionary entry from the given key and value.

name

The key of the entry

value

The value of the entry

Example

lib.gvariant.mkDictionaryEntry usage example

# A dictionary describing an Epiphany’s search provider
[
  (lib.gvariant.mkDictionaryEntry "url" (lib.gvariant.mkVariant "https://duckduckgo.com/?q=%s&t=epiphany"))
  (lib.gvariant.mkDictionaryEntry "bang" (lib.gvariant.mkVariant "!d"))
  (lib.gvariant.mkDictionaryEntry "name" (lib.gvariant.mkVariant "DuckDuckGo"))
]

Located at lib/gvariant.nix:141 in <nixpkgs>.

lib.gvariant.mkMaybe

Type: mkMaybe :: gvariant.type -> Any -> gvariant

Returns the GVariant maybe from the given element type.

elemType

Function argument

elem

Function argument

Located at lib/gvariant.nix:160 in <nixpkgs>.

lib.gvariant.mkNothing

Type: mkNothing :: gvariant.type -> gvariant

Returns the GVariant nothing from the given element type.

elemType

Function argument

Located at lib/gvariant.nix:174 in <nixpkgs>.

lib.gvariant.mkJust

Type: mkJust :: Any -> gvariant

Returns the GVariant just from the given Nix value.

elem

Function argument

Located at lib/gvariant.nix:181 in <nixpkgs>.

lib.gvariant.mkTuple

Type: mkTuple :: [Any] -> gvariant

Returns the GVariant tuple from the given Nix list.

elems

Function argument

Located at lib/gvariant.nix:188 in <nixpkgs>.

lib.gvariant.mkBoolean

Type: mkBoolean :: Bool -> gvariant

Returns the GVariant boolean from the given Nix bool value.

v

Function argument

Located at lib/gvariant.nix:203 in <nixpkgs>.

lib.gvariant.mkString

Type: mkString :: String -> gvariant

Returns the GVariant string from the given Nix string value.

v

Function argument

Located at lib/gvariant.nix:213 in <nixpkgs>.

lib.gvariant.mkObjectpath

Type: mkObjectpath :: String -> gvariant

Returns the GVariant object path from the given Nix string value.

v

Function argument

Located at lib/gvariant.nix:224 in <nixpkgs>.

lib.gvariant.mkUchar

Type: mkUchar :: Int -> gvariant

Returns the GVariant uchar from the given Nix int value.

Located at lib/gvariant.nix:234 in <nixpkgs>.

lib.gvariant.mkInt16

Type: mkInt16 :: Int -> gvariant

Returns the GVariant int16 from the given Nix int value.

Located at lib/gvariant.nix:241 in <nixpkgs>.

lib.gvariant.mkUint16

Type: mkUint16 :: Int -> gvariant

Returns the GVariant uint16 from the given Nix int value.

Located at lib/gvariant.nix:248 in <nixpkgs>.

lib.gvariant.mkInt32

Type: mkInt32 :: Int -> gvariant

Returns the GVariant int32 from the given Nix int value.

v

Function argument

Located at lib/gvariant.nix:255 in <nixpkgs>.

lib.gvariant.mkUint32

Type: mkUint32 :: Int -> gvariant

Returns the GVariant uint32 from the given Nix int value.

Located at lib/gvariant.nix:265 in <nixpkgs>.

lib.gvariant.mkInt64

Type: mkInt64 :: Int -> gvariant

Returns the GVariant int64 from the given Nix int value.

Located at lib/gvariant.nix:272 in <nixpkgs>.

lib.gvariant.mkUint64

Type: mkUint64 :: Int -> gvariant

Returns the GVariant uint64 from the given Nix int value.

Located at lib/gvariant.nix:279 in <nixpkgs>.

lib.gvariant.mkDouble

Type: mkDouble :: Float -> gvariant

Returns the GVariant double from the given Nix float value.

v

Function argument

Located at lib/gvariant.nix:286 in <nixpkgs>.