## SnapdSlot SnapdSlot — Snap slots |

## Functions

const gchar * | snapd_slot_get_name ()
const gchar * | snapd_slot_get_snap ()
const gchar * | snapd_slot_get_interface ()
GStrv | snapd_slot_get_attribute_names ()
gboolean | snapd_slot_has_attribute ()
GVariant * | snapd_slot_get_attribute ()
const gchar * | snapd_slot_get_label ()
GPtrArray * | snapd_slot_get_connections ()
GPtrArray * | snapd_slot_get_connected_plugs ()

## Properties

GHashTable * | attributes | Read / Write / Construct Only
GPtrArray * | connections | Read / Write / Construct Only
char * | interface | Read / Write / Construct Only
char * | label | Read / Write / Construct Only
char * | name | Read / Write / Construct Only
char * | snap | Read / Write / Construct Only

## Types and Values

| SnapdSlot

## Object Hierarchy

        GObject
        ╰── SnapdSlot

## Includes

    #include <snapd-glib/snapd-glib.h>

## Description

A SnapdSlot represents a part of a snap that can be connected to by one or more SnapdPlug from other snaps. Available slots can be queried using `snapd_client_get_interfaces_sync()`. Plugs can be connected / disconnected using `snapd_client_connect_interface_sync()` and `snapd_client_disconnect_interface_sync()`.

## Functions

### snapd_slot_get_name ()

    const gchar *
    snapd_slot_get_name (SnapdSlot *slot);

Get the name of this slot.

#### Parameters

slot | a SnapdSlot. |

#### Returns

a name

Since: 1.0

### snapd_slot_get_snap ()

    const gchar *
    snapd_slot_get_snap (SnapdSlot *slot);

Get the snap this slot is on.

#### Parameters

slot | a SnapdSlot. |

#### Returns

a snap name.

Since: 1.0

### snapd_slot_get_interface ()

    const gchar *
    snapd_slot_get_interface (SnapdSlot *slot);

Get the name of the interface this slot accepts.

#### Parameters

slot | a SnapdSlot. |

#### Returns

an interface name.

Since: 1.0

### snapd_slot_get_attribute_names ()

    GStrv
    snapd_slot_get_attribute_names (SnapdSlot *slot,
                                    guint *length);

Get the names of the attributes this slot has.

#### Parameters

slot | a SnapdSlot. |
length | location to write number of attributes or `NULL` if not required. | [out][allow-none]

#### Returns

a string array of attribute names. Free with `g_strfreev()`.

[transfer full][array zero-terminated=1]

Since: 1.3

### snapd_slot_has_attribute ()

    gboolean
    snapd_slot_has_attribute (SnapdSlot *slot,
                              const gchar *name);

Check if this slot has an attribute.

#### Parameters

slot | a SnapdSlot. |
name | an attribute name. |

#### Returns

`TRUE` if this attribute exists.

Since: 1.3

### snapd_slot_get_attribute ()

    GVariant *
    snapd_slot_get_attribute (SnapdSlot *slot,
                              const gchar *name);

Get an attribute for this interface.

#### Parameters

slot | a SnapdSlot. |
name | an attribute name. |

#### Returns

an attribute value or `NULL` if not set.

[transfer none][allow-none]

Since: 1.3

### snapd_slot_get_label ()

    const gchar *
    snapd_slot_get_label (SnapdSlot *slot);

Get a human readable label for this slot.

#### Parameters

slot | a SnapdSlot. |

#### Returns

a label.

Since: 1.0

### snapd_slot_get_connections ()

    GPtrArray *
    snapd_slot_get_connections (SnapdSlot *slot);

`snapd_slot_get_connections` has been deprecated since version 1.48 and should not be used in newly-written code.

Use `snapd_slot_get_connected_plugs()`

Get the connections being made with this slot.

#### Parameters

slot | a SnapdSlot. |

#### Returns

an array of SnapdConnection.

[transfer none][element-type SnapdConnection]

Since: 1.0

### snapd_slot_get_connected_plugs ()

    GPtrArray *
    snapd_slot_get_connected_plugs (SnapdSlot *slot);

Get the plugs connected to this slot.

#### Parameters

slot | a SnapdSlot. |

#### Returns

an array of SnapdPlugRef.

[transfer none][element-type SnapdPlugRef]

Since: 1.48

## Types and Values

### SnapdSlot

    typedef struct _SnapdSlot SnapdSlot;

SnapdSlot contains information about a Snap slot.

Since: 1.0

## Property Details

### The `“attributes”` property

      “attributes”               GHashTable *

Attributes for this slot.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

### The `“connections”` property

      “connections”              GPtrArray *

Connections with this slot.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

### The `“interface”` property

      “interface”                char *

Interface this slot consumes.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

Default value: NULL

### The `“label”` property

      “label”                    char *

Short description of this slot.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

Default value: NULL

### The `“name”` property

      “name”                     char *

Slot name.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

Default value: NULL

### The `“snap”` property

      “snap”                     char *

Snap this slot is on.

Owner: SnapdSlot

Flags: Read / Write / Construct Only

Default value: NULL