SettingConnection

Struct SettingConnection 

Source
pub struct SettingConnection { /* private fields */ }
Expand description

General Connection Profile Settings

§Properties

§auth-retries

The number of retries for the authentication. Zero means to try indefinitely; -1 means to use a global default. If the global default is not set, the authentication retries for 3 times before failing the connection.

Currently, this only applies to 802-1x authentication.

Readable | Writeable

§autoconnect

Whether or not the connection should be automatically connected by NetworkManager when the resources for the connection are available. true to automatically activate the connection, false to require manual intervention to activate the connection.

Autoconnect happens when the circumstances are suitable. That means for example that the device is currently managed and not active. Autoconnect thus never replaces or competes with an already active profile.

Note that autoconnect is not implemented for VPN profiles. See #NMSettingConnection:secondaries as an alternative to automatically connect VPN profiles.

If multiple profiles are ready to autoconnect on the same device, the one with the better “connection.autoconnect-priority” is chosen. If the priorities are equal, then the most recently connected profile is activated. If the profiles were not connected earlier or their “connection.timestamp” is identical, the choice is undefined.

Depending on “connection.multi-connect”, a profile can (auto)connect only once at a time or multiple times.

Readable | Writeable

§autoconnect-ports

Whether or not ports of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties #NMSettingConnection:autoconnect, #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries are unrelated to this setting. The permitted values are: 0: leave port connections untouched, 1: activate all the port connections with this connection, -1: default. If -1 (default) is set, global connection.autoconnect-ports is read to determine the real value. If it is default as well, this fallbacks to 0.

Readable | Writeable

§autoconnect-priority

The autoconnect priority in range -999 to 999. If the connection is set to autoconnect, connections with higher priority will be preferred. The higher number means higher priority. Defaults to 0. Note that this property only matters if there are more than one candidate profile to select for autoconnect. In case of equal priority, the profile used most recently is chosen.

Readable | Writeable

§autoconnect-retries

The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden). Setting this to 1 means to try activation only once before blocking autoconnect. Note that after a timeout, NetworkManager will try to autoconnect again.

Readable | Writeable

§autoconnect-slaves

Whether or not ports of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties #NMSettingConnection:autoconnect, #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries are unrelated to this setting. The permitted values are: 0: leave port connections untouched, 1: activate all the port connections with this connection, -1: default. If -1 (default) is set, global connection.autoconnect-slaves is read to determine the real value. If it is default as well, this fallbacks to 0.

Deprecated 1.46. Use #NMSettingConnection:autoconnect-ports instead, this is just an alias.

Readable | Writeable

§controller

Interface name of the controller device or UUID of the controller connection.

Readable | Writeable

§dns-over-tls

Whether DNSOverTls (dns-over-tls) is enabled for the connection. DNSOverTls is a technology which uses TLS to encrypt dns traffic.

The permitted values are: “yes” (2) use DNSOverTls and disabled fallback, “opportunistic” (1) use DNSOverTls but allow fallback to unencrypted resolution, “no” (0) don’t ever use DNSOverTls. If unspecified “default” depends on the plugin used. Systemd-resolved uses global setting.

This feature requires a plugin which supports DNSOverTls. Otherwise, the setting has no effect. One such plugin is dns-systemd-resolved.

Readable | Writeable

§down-on-poweroff

Whether the connection will be brought down before the system is powered off. The default value is [SettingConnectionDownOnPoweroff::Default][crate::SettingConnectionDownOnPoweroff::Default]. When the default value is specified, then the global value from NetworkManager configuration is looked up, if not set, it is considered as [SettingConnectionDownOnPoweroff::No][crate::SettingConnectionDownOnPoweroff::No].

Readable | Writeable

§gateway-ping-timeout

If greater than zero, delay success of IP addressing until either the timeout is reached, or an IP gateway replies to a ping.

Readable | Writeable

§id

A human readable unique identifier for the connection, like “Work Wi-Fi” or “T-Mobile 3G”.

Readable | Writeable

§interface-name

The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings).

For software devices this specifies the name of the created device.

For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface.

Readable | Writeable

§ip-ping-addresses

The property specifies a list of target IP addresses for pinging. When multiple targets are set, NetworkManager will start multiple ping processes in parallel. This property can only be set if connection.ip-ping-timeout is set. The ip-ping-timeout is used to delay the success of IP addressing until either the specified timeout (in seconds) is reached, or an target IP address replies to a ping. Configuring #NMSettingConnection:ip-ping-addresses may delay reaching the systemd’s network-online.target due to waiting for the ping operations to complete or timeout.

Readable | Writeable

§ip-ping-addresses-require-all

The property determines whether it is sufficient for any ping check to succeed among #NMSettingConnection:ip-ping-addresses, or if all ping checks must succeed for #NMSettingConnection:ip-ping-addresses.

Readable | Writeable

§ip-ping-timeout

If greater than zero, delay success of IP addressing until either the specified timeout (in seconds) is reached, or a target IP address replies to a ping. The property specifies the timeout for the #NMSettingConnection:ip-ping-addresses. This property is incompatible with #NMSettingConnection:gateway-ping-timeout, you cannot set these two properties at the same time.

Readable | Writeable

§lldp

Whether LLDP is enabled for the connection.

Readable | Writeable

§llmnr

Whether Link-Local Multicast Name Resolution (LLMNR) is enabled for the connection. LLMNR is a protocol based on the Domain Name System (DNS) packet format that allows both IPv4 and IPv6 hosts to perform name resolution for hosts on the same local link.

The permitted values are: “yes” (2) register hostname and resolving for the connection, “no” (0) disable LLMNR for the interface, “resolve” (1) do not register hostname but allow resolving of LLMNR host names If unspecified, “default” ultimately depends on the DNS plugin (which for systemd-resolved currently means “yes”).

This feature requires a plugin which supports LLMNR. Otherwise, the setting has no effect. One such plugin is dns-systemd-resolved.

Readable | Writeable

§master

Interface name of the controller device or UUID of the controller connection.

Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.

Readable | Writeable

§mdns

Whether mDNS is enabled for the connection.

The permitted values are: “yes” (2) register hostname and resolving for the connection, “no” (0) disable mDNS for the interface, “resolve” (1) do not register hostname but allow resolving of mDNS host names and “default” (-1) to allow lookup of a global default in NetworkManager.conf. If unspecified, “default” ultimately depends on the DNS plugin.

This feature requires a plugin which supports mDNS. Otherwise, the setting has no effect. Currently the only supported DNS plugin is systemd-resolved. For systemd-resolved, the default is configurable via MulticastDNS= setting in resolved.conf.

Readable | Writeable

§metered

Whether the connection is metered.

When updating this property on a currently activated connection, the change takes effect immediately.

Readable | Writeable

§mptcp-flags

Whether to configure MPTCP endpoints and the address flags. If MPTCP is enabled in NetworkManager, it will configure the addresses of the interface as MPTCP endpoints. Note that IPv4 loopback addresses (127.0.0.0/8), IPv4 link local addresses (169.254.0.0/16), the IPv6 loopback address (::1), IPv6 link local addresses (fe80::/10), IPv6 unique local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses (rfc3041, ipv6.ip6-privacy) will be excluded from being configured as endpoints.

If “disabled” (0x1), MPTCP handling for the interface is disabled and no endpoints are registered.

The “enabled” (0x2) flag means that MPTCP handling is enabled. This flag can also be implied from the presence of other flags.

Even when enabled, MPTCP handling will by default still be disabled unless “/proc/sys/net/mptcp/enabled” sysctl is on. NetworkManager does not change the sysctl and this is up to the administrator or distribution. To configure endpoints even if the sysctl is disabled, “also-without-sysctl” (0x4) flag can be used. In that case, NetworkManager doesn’t look at the sysctl and configures endpoints regardless.

Even when enabled, NetworkManager will only configure MPTCP endpoints for a certain address family, if there is a unicast default route (0.0.0.0/0 or ::/0) in the main routing table. The flag “also-without-default-route” (0x8) can override that.

When MPTCP handling is enabled then endpoints are configured with the specified address flags “signal” (0x10), “subflow” (0x20), “backup” (0x40), “fullmesh” (0x80). See ip-mptcp(8) manual for additional information about the flags.

If the flags are zero (0x0), the global connection default from NetworkManager.conf is honored. If still unspecified, the fallback is “enabled,subflow”. Note that this means that MPTCP is by default done depending on the “/proc/sys/net/mptcp/enabled” sysctl.

NetworkManager does not change the MPTCP limits nor enable MPTCP via “/proc/sys/net/mptcp/enabled”. That is a host configuration which the admin can change via sysctl and ip-mptcp.

Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would loosen the strict reverse path filtering (1) to the loose setting (2).

Readable | Writeable

§mud-url

If configured, set to a Manufacturer Usage Description (MUD) URL that points to manufacturer-recommended network policies for IoT devices. It is transmitted as a DHCPv4 or DHCPv6 option. The value must be a valid URL starting with “https://”.

The special value “none” is allowed to indicate that no MUD URL is used.

If the per-profile value is unspecified (the default), a global connection default gets consulted. If still unspecified, the ultimate default is “none”.

Readable | Writeable

§multi-connect

Specifies whether the profile can be active multiple times at a particular moment. The value is of type #NMConnectionMultiConnect.

Readable | Writeable

§permissions

An array of strings defining what access a given user has to this connection. If this is None or empty, all users are allowed to access this connection; otherwise users are allowed if and only if they are in this list. When this is not empty, the connection can be active only when one of the specified users is logged into an active session. Each entry is of the form “[type]:[id]:[reserved]”; for example, “user:dcbw:blah”.

At this time only the “user” [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the “:” character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8.

Readable | Writeable

§port-type

Setting name of the device type of this port’s controller connection (eg, SETTING_BOND_SETTING_NAME), or None if this connection is not a port.

Readable | Writeable

§read-only

This property is deprecated and has no meaning.

Readable | Writeable

§secondaries

List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported.

Readable | Writeable

§slave-type

Setting name of the device type of this port’s controller connection (eg, SETTING_BOND_SETTING_NAME), or None if this connection is not a port.

Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias.

Readable | Writeable

§stable-id

This represents the identity of the connection used for various purposes. It allows configuring multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context.

The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable.

Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device’s name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity.

The ‘$’ character is treated special to perform dynamic substitutions at activation time. Currently, supported are “${CONNECTION}”, “${DEVICE}”, “${MAC}”, “${NETWORK_SSID}”, “${BOOT}”, “${RANDOM}”. These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The “${CONNECTION}” uses the profile’s connection.uuid, the “${DEVICE}” uses the interface name of the device and “${MAC}” the permanent MAC address of the device. “${NETWORK_SSID}” uses the SSID for Wi-Fi networks and falls back to “${CONNECTION}” on other networks. Any unrecognized patterns following ‘$’ are treated verbatim, however are reserved for future use. You are thus advised to avoid ‘$’ or escape it as “$$”. For example, set it to “${CONNECTION}-${BOOT}-${DEVICE}” to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates.

If the value is unset, a global connection default is consulted. If the value is still unset, the default is “default${CONNECTION}” go generate an ID unique per connection profile.

Readable | Writeable

§timestamp

The time, in seconds since the Unix Epoch, that the connection was last successfully fully activated.

NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved).

Readable | Writeable

§type

Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, “802-3-ethernet” or “802-11-wireless” or “bluetooth”, etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, “vpn” or “bridge”, etc).

Readable | Writeable

§uuid

A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the #NMSettingConnection:id property or #NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or #NMSettingConnection:type property changes.

The UUID must be in the format “2815492f-7e56-435e-b2e9-246bd7cdc664” (ie, contains only hexadecimal characters and “-”). A suitable UUID may be generated by nm_utils_uuid_generate() or nm_uuid_generate_from_string_str().

Readable | Writeable

§wait-activation-delay

Time in milliseconds to wait for connection to be considered activated. The wait will start after the pre-up dispatcher event.

The value 0 means no wait time. The default value is -1, which currently has the same meaning as no wait time.

Readable | Writeable

§wait-device-timeout

Timeout in milliseconds to wait for device at startup. During boot, devices may take a while to be detected by the driver. This property will cause to delay NetworkManager-wait-online.service and nm-online to give the device a chance to appear. This works by waiting for the given timeout until a compatible device for the profile is available and managed.

The value 0 means no wait time. The default value is -1, which currently has the same meaning as no wait time.

Readable | Writeable

§zone

The trust level of a the connection. Free form case-insensitive string (for example “Home”, “Work”, “Public”). None or unspecified zone means the connection will be placed in the default zone as defined by the firewall.

When updating this property on a currently activated connection, the change takes effect immediately.

Readable | Writeable

Setting

§name

The setting’s name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example “ppp” or “802-11-wireless” or “802-3-ethernet”.

Readable

§Implements

SettingExt

GLib type: GObject with reference counted clone semantics.

Implementations§

Source§

impl SettingConnection

Source

pub fn new() -> SettingConnection

Creates a new #NMSettingConnection object with default values.

§Returns

the new empty #NMSettingConnection object

Source

pub fn builder() -> SettingConnectionBuilder

Creates a new builder-pattern struct instance to construct SettingConnection objects.

This method returns an instance of SettingConnectionBuilder which can be used to create SettingConnection objects.

Source

pub fn add_permission( &self, ptype: &str, pitem: &str, detail: Option<&str>, ) -> bool

Adds a permission to the connection’s permission list. At this time, only the “user” permission type is supported, and @pitem must be a username. See #NMSettingConnection:permissions: for more details.

§ptype

the permission type; at this time only “user” is supported

§pitem

the permission item formatted as required for @ptype

§detail

unused at this time; must be None

§Returns

true if the permission was unique and was successfully added to the list, false if @ptype or @pitem was invalid. If the permission was already present in the list, it will not be added a second time but true will be returned. Note that before 1.28, in this case false would be returned.

Source

pub fn add_secondary(&self, sec_uuid: &str) -> bool

Adds a new secondary connection UUID to the setting.

§sec_uuid

the secondary connection UUID to add

§Returns

true if the secondary connection UUID was added; false if the UUID was already present

Source

pub fn auth_retries(&self) -> i32

Available on crate feature v1_10 only.

Returns the value contained in the #NMSettingConnection:auth-retries property.

§Returns

the configured authentication retries. Zero means infinity and -1 means a global default value.

Source

pub fn is_autoconnect(&self) -> bool

Returns the #NMSettingConnection:autoconnect property of the connection.

§Returns

the connection’s autoconnect behavior

Source

pub fn autoconnect_priority(&self) -> i32

Returns the #NMSettingConnection:autoconnect-priority property of the connection. The higher number, the higher priority.

§Returns

the connection’s autoconnect priority

Source

pub fn autoconnect_retries(&self) -> i32

Available on crate feature v1_6 only.

Returns the #NMSettingConnection:autoconnect-retries property of the connection. Zero means infinite, -1 means the global default value.

§Returns

the connection’s autoconnect retries

Source

pub fn autoconnect_slaves(&self) -> SettingConnectionAutoconnectSlaves

Available on crate feature v1_2 only.

Returns the #NMSettingConnection:autoconnect-slaves property of the connection.

§Deprecated since 1.46

Use nm_setting_connection_get_autoconnect_ports() instead, this is just an alias.

§Returns

whether ports of the connection should be activated together with the connection.

Source

pub fn connection_type(&self) -> GString

Returns the #NMSettingConnection:type property of the connection.

§Returns

the connection type

Source

pub fn gateway_ping_timeout(&self) -> u32

§Returns

the value contained in the #NMSettingConnection:gateway-ping-timeout property.

Source

pub fn id(&self) -> GString

Returns the #NMSettingConnection:id property of the connection.

§Returns

the connection ID

Source

pub fn interface_name(&self) -> GString

Returns the #NMSettingConnection:interface-name property of the connection.

§Returns

the connection’s interface name

Source

pub fn lldp(&self) -> SettingConnectionLldp

Available on crate feature v1_2 only.

Returns the #NMSettingConnection:lldp property of the connection.

§Returns

a NMSettingConnectionLldp which indicates whether LLDP must be enabled for the connection.

Source

pub fn llmnr(&self) -> SettingConnectionLlmnr

Available on crate feature v1_14 only.
§Returns

the #NMSettingConnection:llmnr property of the setting.

Source

pub fn master(&self) -> GString

Returns the #NMSettingConnection:master property of the connection.

§Deprecated since 1.46

Use nm_setting_connection_get_master() instead which is just an alias.

§Returns

interface name of the controller device or UUID of the controller connection.

Source

pub fn mdns(&self) -> SettingConnectionMdns

Available on crate feature v1_12 only.
§Returns

the #NMSettingConnection:mdns property of the setting.

Source

pub fn metered(&self) -> Metered

Available on crate feature v1_2 only.
§Returns

the #NMSettingConnection:metered property of the setting.

Source

pub fn mptcp_flags(&self) -> MptcpFlags

Available on crate feature v1_42 only.
§Returns

the #NMSettingConnection:mptcp-flags property of the setting.

Source

pub fn multi_connect(&self) -> ConnectionMultiConnect

Available on crate feature v1_14 only.
§Returns

the #NMSettingConnection:multi-connect property of the connection.

Source

pub fn num_permissions(&self) -> u32

Returns the number of entries in the #NMSettingConnection:permissions property of this setting.

§Returns

the number of permissions entries

Source

pub fn num_secondaries(&self) -> u32

§Returns

the number of configured secondary connection UUIDs

Source

pub fn is_permission( &self, idx: u32, out_ptype: &mut str, out_pitem: &mut str, out_detail: &mut str, ) -> bool

Retrieve one of the entries of the #NMSettingConnection:permissions property of this setting.

§idx

the zero-based index of the permissions entry

§out_ptype

on return, the permission type. This is currently always “user”, unless the entry is invalid, in which case it returns “invalid”.

§out_pitem

on return, the permission item (formatted according to @ptype, see #NMSettingConnection:permissions for more detail

§out_detail

on return, the permission detail (at this time, always None)

§Returns

true if a permission was returned, false if @idx was invalid

Source

pub fn is_read_only(&self) -> bool

Returns the #NMSettingConnection:read-only property of the connection.

§Deprecated since 1.44

This property is deprecated and has no meaning.

§Returns

true if the connection is read-only, false if it is not

Source

pub fn secondary(&self, idx: u32) -> GString

§idx

the zero-based index of the secondary connection UUID entry. Access one past the length of secondaries is ok and will return None. Otherwise, it is a user error.

§Returns

the secondary connection UUID at index @idx or None if @idx is the number of secondaries.

Source

pub fn slave_type(&self) -> GString

Returns the #NMSettingConnection:slave-type property of the connection.

§Deprecated since 1.46

Use nm_setting_connection_get_port_type() instead which is just an alias.

§Returns

the type of port this connection is, if any

Source

pub fn stable_id(&self) -> GString

Available on crate feature v1_4 only.

Returns the #NMSettingConnection:stable_id property of the connection.

§Returns

the stable-id for the connection

Source

pub fn timestamp(&self) -> u64

Returns the #NMSettingConnection:timestamp property of the connection.

§Returns

the connection’s timestamp

Source

pub fn uuid(&self) -> GString

Returns the #NMSettingConnection:uuid property of the connection.

§Returns

the connection UUID

Source

pub fn wait_activation_delay(&self) -> i32

Available on crate feature v1_40 only.
§Returns

the SETTING_CONNECTION_WAIT_ACTIVATION_DELAY property with the delay in milliseconds. -1 is the default.

Source

pub fn wait_device_timeout(&self) -> i32

Available on crate feature v1_20 only.
§Returns

the SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT property with the timeout in milliseconds. -1 is the default.

Source

pub fn zone(&self) -> GString

Returns the #NMSettingConnection:zone property of the connection.

§Returns

the trust level of a connection

Source

pub fn is_slave_type(&self, type_: &str) -> bool

§Deprecated since 1.46
§type_

the setting name (ie #NM_SETTING_BOND_SETTING_NAME) to be matched against @self’s port type

§Returns

true if connection is of the given port @type_

Source

pub fn permissions_user_allowed(&self, uname: &str) -> bool

Checks whether the given username is allowed to view/access this connection.

§uname

the user name to check permissions for

§Returns

true if the requested user is allowed to view this connection, false if the given user is not allowed to view this connection

Source

pub fn remove_permission(&self, idx: u32)

Removes the permission at index @idx from the connection.

§idx

the zero-based index of the permission to remove

Source

pub fn remove_permission_by_value( &self, ptype: &str, pitem: &str, detail: Option<&str>, ) -> bool

Removes the permission from the connection. At this time, only the “user” permission type is supported, and @pitem must be a username. See #NMSettingConnection:permissions: for more details.

§ptype

the permission type; at this time only “user” is supported

§pitem

the permission item formatted as required for @ptype

§detail

unused at this time; must be None

§Returns

true if the permission was found and removed; false if it was not.

Source

pub fn remove_secondary(&self, idx: u32)

Removes the secondary connection UUID at index @idx.

§idx

index number of the secondary connection UUID

Source

pub fn remove_secondary_by_value(&self, sec_uuid: &str) -> bool

Removes the secondary connection UUID @sec_uuid.

§sec_uuid

the secondary connection UUID to remove

§Returns

true if the secondary connection UUID was found and removed; false if it was not.

Source

pub fn set_auth_retries(&self, auth_retries: i32)

Available on crate feature v1_10 only.

The number of retries for the authentication. Zero means to try indefinitely; -1 means to use a global default. If the global default is not set, the authentication retries for 3 times before failing the connection.

Currently, this only applies to 802-1x authentication.

Source

pub fn set_autoconnect(&self, autoconnect: bool)

Whether or not the connection should be automatically connected by NetworkManager when the resources for the connection are available. true to automatically activate the connection, false to require manual intervention to activate the connection.

Autoconnect happens when the circumstances are suitable. That means for example that the device is currently managed and not active. Autoconnect thus never replaces or competes with an already active profile.

Note that autoconnect is not implemented for VPN profiles. See #NMSettingConnection:secondaries as an alternative to automatically connect VPN profiles.

If multiple profiles are ready to autoconnect on the same device, the one with the better “connection.autoconnect-priority” is chosen. If the priorities are equal, then the most recently connected profile is activated. If the profiles were not connected earlier or their “connection.timestamp” is identical, the choice is undefined.

Depending on “connection.multi-connect”, a profile can (auto)connect only once at a time or multiple times.

Source

pub fn set_autoconnect_priority(&self, autoconnect_priority: i32)

The autoconnect priority in range -999 to 999. If the connection is set to autoconnect, connections with higher priority will be preferred. The higher number means higher priority. Defaults to 0. Note that this property only matters if there are more than one candidate profile to select for autoconnect. In case of equal priority, the profile used most recently is chosen.

Source

pub fn set_autoconnect_retries(&self, autoconnect_retries: i32)

The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden). Setting this to 1 means to try activation only once before blocking autoconnect. Note that after a timeout, NetworkManager will try to autoconnect again.

Source

pub fn set_autoconnect_slaves( &self, autoconnect_slaves: SettingConnectionAutoconnectSlaves, )

Available on crate feature v1_2 only.

Whether or not ports of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties #NMSettingConnection:autoconnect, #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries are unrelated to this setting. The permitted values are: 0: leave port connections untouched, 1: activate all the port connections with this connection, -1: default. If -1 (default) is set, global connection.autoconnect-slaves is read to determine the real value. If it is default as well, this fallbacks to 0.

Deprecated 1.46. Use #NMSettingConnection:autoconnect-ports instead, this is just an alias.

Source

pub fn controller(&self) -> Option<GString>

Available on non-crate feature v1_46 only.
Source

pub fn set_controller(&self, controller: Option<&str>)

Interface name of the controller device or UUID of the controller connection.

Source

pub fn set_gateway_ping_timeout(&self, gateway_ping_timeout: u32)

If greater than zero, delay success of IP addressing until either the timeout is reached, or an IP gateway replies to a ping.

Source

pub fn set_id(&self, id: Option<&str>)

A human readable unique identifier for the connection, like “Work Wi-Fi” or “T-Mobile 3G”.

Source

pub fn set_interface_name(&self, interface_name: Option<&str>)

The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings).

For software devices this specifies the name of the created device.

For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface.

Source

pub fn set_lldp(&self, lldp: i32)

Available on crate feature v1_2 only.

Whether LLDP is enabled for the connection.

Source

pub fn set_llmnr(&self, llmnr: i32)

Available on crate feature v1_14 only.

Whether Link-Local Multicast Name Resolution (LLMNR) is enabled for the connection. LLMNR is a protocol based on the Domain Name System (DNS) packet format that allows both IPv4 and IPv6 hosts to perform name resolution for hosts on the same local link.

The permitted values are: “yes” (2) register hostname and resolving for the connection, “no” (0) disable LLMNR for the interface, “resolve” (1) do not register hostname but allow resolving of LLMNR host names If unspecified, “default” ultimately depends on the DNS plugin (which for systemd-resolved currently means “yes”).

This feature requires a plugin which supports LLMNR. Otherwise, the setting has no effect. One such plugin is dns-systemd-resolved.

Source

pub fn set_master(&self, master: Option<&str>)

Interface name of the controller device or UUID of the controller connection.

Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.

Source

pub fn set_mdns(&self, mdns: i32)

Available on crate feature v1_12 only.

Whether mDNS is enabled for the connection.

The permitted values are: “yes” (2) register hostname and resolving for the connection, “no” (0) disable mDNS for the interface, “resolve” (1) do not register hostname but allow resolving of mDNS host names and “default” (-1) to allow lookup of a global default in NetworkManager.conf. If unspecified, “default” ultimately depends on the DNS plugin.

This feature requires a plugin which supports mDNS. Otherwise, the setting has no effect. Currently the only supported DNS plugin is systemd-resolved. For systemd-resolved, the default is configurable via MulticastDNS= setting in resolved.conf.

Source

pub fn set_metered(&self, metered: Metered)

Available on crate feature v1_2 only.

Whether the connection is metered.

When updating this property on a currently activated connection, the change takes effect immediately.

Source

pub fn set_mptcp_flags(&self, mptcp_flags: u32)

Available on crate feature v1_40 only.

Whether to configure MPTCP endpoints and the address flags. If MPTCP is enabled in NetworkManager, it will configure the addresses of the interface as MPTCP endpoints. Note that IPv4 loopback addresses (127.0.0.0/8), IPv4 link local addresses (169.254.0.0/16), the IPv6 loopback address (::1), IPv6 link local addresses (fe80::/10), IPv6 unique local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses (rfc3041, ipv6.ip6-privacy) will be excluded from being configured as endpoints.

If “disabled” (0x1), MPTCP handling for the interface is disabled and no endpoints are registered.

The “enabled” (0x2) flag means that MPTCP handling is enabled. This flag can also be implied from the presence of other flags.

Even when enabled, MPTCP handling will by default still be disabled unless “/proc/sys/net/mptcp/enabled” sysctl is on. NetworkManager does not change the sysctl and this is up to the administrator or distribution. To configure endpoints even if the sysctl is disabled, “also-without-sysctl” (0x4) flag can be used. In that case, NetworkManager doesn’t look at the sysctl and configures endpoints regardless.

Even when enabled, NetworkManager will only configure MPTCP endpoints for a certain address family, if there is a unicast default route (0.0.0.0/0 or ::/0) in the main routing table. The flag “also-without-default-route” (0x8) can override that.

When MPTCP handling is enabled then endpoints are configured with the specified address flags “signal” (0x10), “subflow” (0x20), “backup” (0x40), “fullmesh” (0x80). See ip-mptcp(8) manual for additional information about the flags.

If the flags are zero (0x0), the global connection default from NetworkManager.conf is honored. If still unspecified, the fallback is “enabled,subflow”. Note that this means that MPTCP is by default done depending on the “/proc/sys/net/mptcp/enabled” sysctl.

NetworkManager does not change the MPTCP limits nor enable MPTCP via “/proc/sys/net/mptcp/enabled”. That is a host configuration which the admin can change via sysctl and ip-mptcp.

Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would loosen the strict reverse path filtering (1) to the loose setting (2).

Source

pub fn set_multi_connect(&self, multi_connect: i32)

Available on crate feature v1_14 only.

Specifies whether the profile can be active multiple times at a particular moment. The value is of type #NMConnectionMultiConnect.

Source

pub fn permissions(&self) -> Vec<GString>

An array of strings defining what access a given user has to this connection. If this is None or empty, all users are allowed to access this connection; otherwise users are allowed if and only if they are in this list. When this is not empty, the connection can be active only when one of the specified users is logged into an active session. Each entry is of the form “[type]:[id]:[reserved]”; for example, “user:dcbw:blah”.

At this time only the “user” [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the “:” character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8.

Source

pub fn set_permissions(&self, permissions: &[&str])

An array of strings defining what access a given user has to this connection. If this is None or empty, all users are allowed to access this connection; otherwise users are allowed if and only if they are in this list. When this is not empty, the connection can be active only when one of the specified users is logged into an active session. Each entry is of the form “[type]:[id]:[reserved]”; for example, “user:dcbw:blah”.

At this time only the “user” [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the “:” character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8.

Source

pub fn set_read_only(&self, read_only: bool)

This property is deprecated and has no meaning.

§Deprecated since 1.44

This property is deprecated and has no meaning.

Source

pub fn secondaries(&self) -> Vec<GString>

List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported.

Source

pub fn set_secondaries(&self, secondaries: &[&str])

List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported.

Source

pub fn set_slave_type(&self, slave_type: Option<&str>)

Setting name of the device type of this port’s controller connection (eg, SETTING_BOND_SETTING_NAME), or None if this connection is not a port.

Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias.

Source

pub fn set_stable_id(&self, stable_id: Option<&str>)

Available on crate feature v1_4 only.

This represents the identity of the connection used for various purposes. It allows configuring multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context.

The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable.

Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device’s name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity.

The ‘$’ character is treated special to perform dynamic substitutions at activation time. Currently, supported are “${CONNECTION}”, “${DEVICE}”, “${MAC}”, “${NETWORK_SSID}”, “${BOOT}”, “${RANDOM}”. These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The “${CONNECTION}” uses the profile’s connection.uuid, the “${DEVICE}” uses the interface name of the device and “${MAC}” the permanent MAC address of the device. “${NETWORK_SSID}” uses the SSID for Wi-Fi networks and falls back to “${CONNECTION}” on other networks. Any unrecognized patterns following ‘$’ are treated verbatim, however are reserved for future use. You are thus advised to avoid ‘$’ or escape it as “$$”. For example, set it to “${CONNECTION}-${BOOT}-${DEVICE}” to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates.

If the value is unset, a global connection default is consulted. If the value is still unset, the default is “default${CONNECTION}” go generate an ID unique per connection profile.

Source

pub fn set_timestamp(&self, timestamp: u64)

The time, in seconds since the Unix Epoch, that the connection was last successfully fully activated.

NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved).

Source

pub fn type_(&self) -> Option<GString>

Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, “802-3-ethernet” or “802-11-wireless” or “bluetooth”, etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, “vpn” or “bridge”, etc).

Source

pub fn set_type(&self, type_: Option<&str>)

Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, “802-3-ethernet” or “802-11-wireless” or “bluetooth”, etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, “vpn” or “bridge”, etc).

Source

pub fn set_uuid(&self, uuid: Option<&str>)

A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the #NMSettingConnection:id property or #NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or #NMSettingConnection:type property changes.

The UUID must be in the format “2815492f-7e56-435e-b2e9-246bd7cdc664” (ie, contains only hexadecimal characters and “-”). A suitable UUID may be generated by nm_utils_uuid_generate() or nm_uuid_generate_from_string_str().

Source

pub fn set_wait_activation_delay(&self, wait_activation_delay: i32)

Available on crate feature v1_40 only.

Time in milliseconds to wait for connection to be considered activated. The wait will start after the pre-up dispatcher event.

The value 0 means no wait time. The default value is -1, which currently has the same meaning as no wait time.

Source

pub fn set_wait_device_timeout(&self, wait_device_timeout: i32)

Available on crate feature v1_20 only.

Timeout in milliseconds to wait for device at startup. During boot, devices may take a while to be detected by the driver. This property will cause to delay NetworkManager-wait-online.service and nm-online to give the device a chance to appear. This works by waiting for the given timeout until a compatible device for the profile is available and managed.

The value 0 means no wait time. The default value is -1, which currently has the same meaning as no wait time.

Source

pub fn set_zone(&self, zone: Option<&str>)

The trust level of a the connection. Free form case-insensitive string (for example “Home”, “Work”, “Public”). None or unspecified zone means the connection will be placed in the default zone as defined by the firewall.

When updating this property on a currently activated connection, the change takes effect immediately.

Source

pub fn connect_auth_retries_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_10 only.
Source

pub fn connect_autoconnect_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_autoconnect_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_autoconnect_retries_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_autoconnect_slaves_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_2 only.
Source

pub fn connect_controller_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_gateway_ping_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

pub fn connect_interface_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_lldp_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_2 only.
Source

pub fn connect_llmnr_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_14 only.
Source

pub fn connect_master_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_mdns_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_12 only.
Source

pub fn connect_metered_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_2 only.
Source

pub fn connect_mptcp_flags_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_40 only.
Source

pub fn connect_multi_connect_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_14 only.
Source

pub fn connect_permissions_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_read_only_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_secondaries_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_slave_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_stable_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_4 only.
Source

pub fn connect_timestamp_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_uuid_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

pub fn connect_wait_activation_delay_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_40 only.
Source

pub fn connect_wait_device_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_20 only.
Source

pub fn connect_zone_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Trait Implementations§

Source§

impl Clone for SettingConnection

Source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SettingConnection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SettingConnection

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HasParamSpec for SettingConnection

Source§

type ParamSpec = ParamSpecObject

Source§

type SetValue = SettingConnection

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(&str) -> ParamSpecObjectBuilder<'_, SettingConnection>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for SettingConnection

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes the memory address of this object.

1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SettingConnection

Source§

fn cmp(&self, other: &Self) -> Ordering

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl ParentClassIs for SettingConnection

Source§

impl<OT: ObjectType> PartialEq<OT> for SettingConnection

Source§

fn eq(&self, other: &OT) -> bool

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<OT: ObjectType> PartialOrd<OT> for SettingConnection

Source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for SettingConnection

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl Eq for SettingConnection

Source§

impl IsA<Setting> for SettingConnection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Cast for T
where T: ObjectType,

Source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
Source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
Source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
Source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
Source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
Source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
Source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<U> IsSubclassableExt for U

Source§

impl<T> ObjectExt for T
where T: ObjectType,

Source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
Source§

fn type_(&self) -> Type

Returns the type of the object.
Source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
Source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
Source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
Source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
Source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
Source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
Source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
Source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
Source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
Source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
Source§

fn has_property(&self, property_name: &str) -> bool

Check if the object has a property property_name.
Source§

fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool

Check if the object has a property property_name of the given type_.
Source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
Source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
Source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
Source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
Source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
Source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
Source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
Source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
Source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
Source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
Source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
Source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
Source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
Source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
Source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
Source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
Source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
Source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
Source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
Source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
Source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
Source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
Source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
Source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
Source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
Source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
Source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
Source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
Source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
Source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
Source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
Source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
Source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<O> SettingExt for O
where O: IsA<Setting>,

Source§

fn compare(&self, b: &impl IsA<Setting>, flags: SettingCompareFlags) -> bool

Source§

fn duplicate(&self) -> Setting

Duplicates a #NMSetting. Read more
Source§

fn name(&self) -> GString

Returns the type name of the #NMSetting object Read more
Source§

fn secret_flags( &self, secret_name: &str, out_flags: SettingSecretFlags, ) -> Result<(), Error>

For a given secret, retrieves the #NMSettingSecretFlags describing how to handle that secret. Read more
Source§

fn set_secret_flags( &self, secret_name: &str, flags: SettingSecretFlags, ) -> Result<(), Error>

For a given secret, stores the #NMSettingSecretFlags describing how to handle that secret. Read more
Source§

fn to_str(&self) -> GString

Convert the setting (including secrets!) into a string. For debugging purposes ONLY, should NOT be used for serialization of the setting, or machine-parsed in any way. The output format is not guaranteed to be stable and may change at any time. Read more
Source§

fn verify(&self, connection: Option<&impl IsA<Connection>>) -> Result<(), Error>

Validates the setting. Each setting’s properties have allowed values, and some are dependent on other values (hence the need for @connection). The returned #GError contains information about which property of the setting failed validation, and in what way that property failed validation. Read more
Source§

fn verify_secrets( &self, connection: Option<&impl IsA<Connection>>, ) -> Result<(), Error>

Available on crate feature v1_2 only.
Verifies the secrets in the setting. The returned #GError contains information about which secret of the setting failed validation, and in what way that secret failed validation. The secret validation is done separately from main setting validation, because in some cases connection failure is not desired just for the secrets. Read more
Source§

fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

Source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,