pub struct Client { /* private fields */ }Expand description
GLib type: GObject with reference counted clone semantics.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(cancellable: Option<&impl IsA<Cancellable>>) -> Result<Client, Error>
pub fn new(cancellable: Option<&impl IsA<Cancellable>>) -> Result<Client, Error>
Creates a new #NMClient synchronously.
Note that this will block until a NMClient instance is fully initialized. This does nothing beside calling g_initable_new(). You are free to call g_initable_new() or g_object_new()/g_initable_init() directly for more control, to set GObject properties or get access to the NMClient instance while it is still initializing.
Using the synchronous initialization creates an #NMClient instance that uses an internal #GMainContext. This context is invisible to the user. This introduces an additional overhead that is payed not only during object initialization, but for the entire lifetime of this object. Also, due to this internal #GMainContext, the events are no longer in sync with other messages from #GDBusConnection (but all events of the NMClient will themselves still be ordered). For a serious program, you should therefore avoid these problems by using g_async_initable_init_async() or nm_client_new_async() instead. The sync initialization is still useful for simple scripts or interactive testing for example via pygobject.
Creating an #NMClient instance can only fail for two reasons. First, if you didn’t
provide a CLIENT_DBUS_CONNECTION and the call to g_bus_get()
fails. You can avoid that by using g_initable_new() directly and
set a D-Bus connection.
Second, if you cancelled the creation. If you do that, then note
that after the failure there might still be idle actions pending
which keep nm_client_get_main_context() alive. That means,
in that case you must continue iterating the context to avoid
leaks. See nm_client_get_context_busy_watcher().
Creating an #NMClient instance when NetworkManager is not running does not cause a failure.
§cancellable
a #GCancellable, or None
§Returns
a new #NMClient or NULL on an error
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a new builder-pattern struct instance to construct Client objects.
This method returns an instance of ClientBuilder which can be used to create Client objects.
Sourcepub fn activate_connection_async<P: FnOnce(Result<ActiveConnection, Error>) + 'static>(
&self,
connection: Option<&impl IsA<Connection>>,
device: Option<&impl IsA<Device>>,
specific_object: Option<&str>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn activate_connection_async<P: FnOnce(Result<ActiveConnection, Error>) + 'static>( &self, connection: Option<&impl IsA<Connection>>, device: Option<&impl IsA<Device>>, specific_object: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously starts a connection to a particular network using the configuration settings from @connection and the network device @device. Certain connection types also take a “specific object” which is the object path of a connection- specific object, like an #NMAccessPoint for Wi-Fi connections, or an #NMWimaxNsp for WiMAX connections, to which you wish to connect. If the specific object is not given, NetworkManager can, in some cases, automatically determine which network to connect to given the settings in @connection.
If @connection is not given for a device-based activation, NetworkManager picks the best available connection for the device and activates it.
Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can use the returned #NMActiveConnection object (in particular, #NMActiveConnection:state) to track the activation to its completion.
§connection
an #NMConnection
§device
the #NMDevice
§specific_object
the object path of a connection-type-specific
object this activation should use. This parameter is currently ignored for
wired and mobile broadband connections, and the value of None should be used
(ie, no specific object). For Wi-Fi or WiMAX connections, pass the object
path of a #NMAccessPoint or #NMWimaxNsp owned by @device, which you can
get using nm_object_get_path(), and which will be used to complete the
details of the newly added connection.
§cancellable
a #GCancellable, or None
§callback
callback to be called when the activation has started
pub fn activate_connection_future( &self, connection: Option<&(impl IsA<Connection> + Clone + 'static)>, device: Option<&(impl IsA<Device> + Clone + 'static)>, specific_object: Option<&str>, ) -> Pin<Box_<dyn Future<Output = Result<ActiveConnection, Error>> + 'static>>
Sourcepub fn add_and_activate_connection_async<P: FnOnce(Result<ActiveConnection, Error>) + 'static>(
&self,
partial: Option<&impl IsA<Connection>>,
device: Option<&impl IsA<Device>>,
specific_object: Option<&str>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn add_and_activate_connection_async<P: FnOnce(Result<ActiveConnection, Error>) + 'static>( &self, partial: Option<&impl IsA<Connection>>, device: Option<&impl IsA<Device>>, specific_object: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object. The new connection is then asynchronously activated as with nm_client_activate_connection_async(). Cannot be used for VPN connections at this time.
Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can used the returned #NMActiveConnection object (in particular, #NMActiveConnection:state) to track the activation to its completion.
§partial
an #NMConnection to add; the connection may be
partially filled (or even None) and will be completed by NetworkManager
using the given @device and @specific_object before being added
§device
the #NMDevice
§specific_object
the object path of a connection-type-specific
object this activation should use. This parameter is currently ignored for
wired and mobile broadband connections, and the value of None should be used
(ie, no specific object). For Wi-Fi or WiMAX connections, pass the object
path of a #NMAccessPoint or #NMWimaxNsp owned by @device, which you can
get using nm_object_get_path(), and which will be used to complete the
details of the newly added connection.
If the variant is floating, it will be consumed.
§cancellable
a #GCancellable, or None
§callback
callback to be called when the activation has started
pub fn add_and_activate_connection_future( &self, partial: Option<&(impl IsA<Connection> + Clone + 'static)>, device: Option<&(impl IsA<Device> + Clone + 'static)>, specific_object: Option<&str>, ) -> Pin<Box_<dyn Future<Output = Result<ActiveConnection, Error>> + 'static>>
Sourcepub fn add_connection_async<P: FnOnce(Result<RemoteConnection, Error>) + 'static>(
&self,
connection: &impl IsA<Connection>,
save_to_disk: bool,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn add_connection_async<P: FnOnce(Result<RemoteConnection, Error>) + 'static>( &self, connection: &impl IsA<Connection>, save_to_disk: bool, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Requests that the remote settings service add the given settings to a new
connection. If @save_to_disk is true, the connection is immediately written
to disk; otherwise it is initially only stored in memory, but may be saved
later by calling the connection’s nm_remote_connection_commit_changes()
method.
@connection is untouched by this function and only serves as a template of the settings to add. The #NMRemoteConnection object that represents what NetworkManager actually added is returned to @callback when the addition operation is complete.
Note that the #NMRemoteConnection returned in @callback may not contain identical settings to @connection as NetworkManager may perform automatic completion and/or normalization of connection properties.
§connection
the connection to add. Note that this object’s settings will be added, not the object itself
§save_to_disk
whether to immediately save the connection to disk
§cancellable
a #GCancellable, or None
§callback
callback to be called when the add operation completes
pub fn add_connection_future( &self, connection: &(impl IsA<Connection> + Clone + 'static), save_to_disk: bool, ) -> Pin<Box_<dyn Future<Output = Result<RemoteConnection, Error>> + 'static>>
Sourcepub fn check_connectivity(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<ConnectivityState, Error>
pub fn check_connectivity( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<ConnectivityState, Error>
Updates the network connectivity state and returns the (new) current state. Contrast nm_client_get_connectivity(), which returns the most recent known state without re-checking.
This is a blocking call; use nm_client_check_connectivity_async() if you do not want to block.
§Deprecated since 1.22
Use nm_client_check_connectivity_async() or GDBusConnection.
§cancellable
a #GCancellable
§Returns
the (new) current connectivity state
Sourcepub fn check_connectivity_async<P: FnOnce(Result<ConnectivityState, Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn check_connectivity_async<P: FnOnce(Result<ConnectivityState, Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously updates the network connectivity state and invokes @callback when complete. Contrast nm_client_get_connectivity(), which (immediately) returns the most recent known state without re-checking, and nm_client_check_connectivity(), which blocks.
§cancellable
a #GCancellable
§callback
callback to call with the result
pub fn check_connectivity_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<ConnectivityState, Error>> + 'static>>
Sourcepub fn checkpoint_adjust_rollback_timeout<P: FnOnce(Result<(), Error>) + 'static>(
&self,
checkpoint_path: &str,
add_timeout: u32,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
Available on crate feature v1_12 only.
pub fn checkpoint_adjust_rollback_timeout<P: FnOnce(Result<(), Error>) + 'static>( &self, checkpoint_path: &str, add_timeout: u32, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
v1_12 only.Resets the timeout for the checkpoint with path @checkpoint_path to @timeout_add.
§checkpoint_path
a D-Bus path to a checkpoint
§add_timeout
the timeout in seconds counting from now. Set to zero, to disable the timeout.
§cancellable
a #GCancellable, or None
§callback
callback to be called when the add operation completes
pub fn checkpoint_adjust_rollback_timeout_future( &self, checkpoint_path: &str, add_timeout: u32, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
v1_12 only.Sourcepub fn checkpoint_create<P: FnOnce(Result<Checkpoint, Error>) + 'static>(
&self,
devices: &[Device],
rollback_timeout: u32,
flags: CheckpointCreateFlags,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
Available on crate feature v1_12 only.
pub fn checkpoint_create<P: FnOnce(Result<Checkpoint, Error>) + 'static>( &self, devices: &[Device], rollback_timeout: u32, flags: CheckpointCreateFlags, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
v1_12 only.Creates a checkpoint of the current networking configuration for given interfaces. An empty @devices argument means all devices. If @rollback_timeout is not zero, a rollback is automatically performed after the given timeout.
§devices
a list of devices for which a checkpoint should be created.
§rollback_timeout
the rollback timeout in seconds
§flags
creation flags
§cancellable
a #GCancellable, or None
§callback
callback to be called when the add operation completes
pub fn checkpoint_create_future( &self, devices: &[Device], rollback_timeout: u32, flags: CheckpointCreateFlags, ) -> Pin<Box_<dyn Future<Output = Result<Checkpoint, Error>> + 'static>>
v1_12 only.pub fn checkpoint_destroy<P: FnOnce(Result<(), Error>) + 'static>( &self, checkpoint_path: &str, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
v1_12 only.pub fn checkpoint_destroy_future( &self, checkpoint_path: &str, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
v1_12 only.Sourcepub fn connectivity_check_get_available(&self) -> bool
Available on crate feature v1_10 only.
pub fn connectivity_check_get_available(&self) -> bool
v1_10 only.Sourcepub fn connectivity_check_get_enabled(&self) -> bool
Available on crate feature v1_10 only.
pub fn connectivity_check_get_enabled(&self) -> bool
v1_10 only.Sourcepub fn connectivity_check_get_uri(&self) -> GString
Available on crate feature v1_20 only.
pub fn connectivity_check_get_uri(&self) -> GString
v1_20 only.Get the URI that will be queried to determine if there is internet connectivity.
§Returns
the connectivity URI in use
Sourcepub fn connectivity_check_set_enabled(&self, enabled: bool)
Available on crate feature v1_10 only.
pub fn connectivity_check_set_enabled(&self, enabled: bool)
v1_10 only.Enable or disable connectivity checking. Note that if a connectivity checking URI has not been configured, this will not have any effect.
§Deprecated since 1.22
Use the async command nm_client_dbus_set_property() on DBUS_PATH,
DBUS_INTERFACE to set “ConnectivityCheckEnabled” property to a “(b)” value.
§enabled
true to enable connectivity checking
Sourcepub fn deactivate_connection(
&self,
active: &impl IsA<ActiveConnection>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
pub fn deactivate_connection( &self, active: &impl IsA<ActiveConnection>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Sourcepub fn deactivate_connection_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
active: &impl IsA<ActiveConnection>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn deactivate_connection_async<P: FnOnce(Result<(), Error>) + 'static>( &self, active: &impl IsA<ActiveConnection>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn deactivate_connection_future( &self, active: &(impl IsA<ActiveConnection> + Clone + 'static), ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcepub fn activating_connection(&self) -> ActiveConnection
pub fn activating_connection(&self) -> ActiveConnection
Gets the #NMActiveConnection corresponding to a currently-activating connection that is expected to become the new #NMClient:primary-connection upon successful activation.
§Returns
the appropriate #NMActiveConnection, if any.
Sourcepub fn active_connections(&self) -> Vec<ActiveConnection>
pub fn active_connections(&self) -> Vec<ActiveConnection>
Gets the active connections.
§Returns
a #GPtrArray containing all the active #NMActiveConnections. The returned array is owned by the client and should not be modified.
Sourcepub fn all_devices(&self) -> Vec<Device>
Available on crate feature v1_2 only.
pub fn all_devices(&self) -> Vec<Device>
v1_2 only.Gets both real devices and device placeholders (eg, software devices which do not currently exist, but could be created automatically by NetworkManager if one of their NMDevice::ActivatableConnections was activated). Use nm_device_is_real() to determine whether each device is a real device or a placeholder.
Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine what kind of device each member of the returned array is, and then you may use device-specific methods such as nm_device_ethernet_get_hw_address().
§Returns
a #GPtrArray containing all the #NMDevices. The returned array is owned by the #NMClient object and should not be modified.
Sourcepub fn checkpoints(&self) -> Vec<Checkpoint>
Available on crate feature v1_12 only.
pub fn checkpoints(&self) -> Vec<Checkpoint>
v1_12 only.Gets all the active checkpoints.
§Returns
a #GPtrArray containing all the #NMCheckpoint. The returned array is owned by the #NMClient object and should not be modified.
Sourcepub fn connection_by_id(&self, id: &str) -> RemoteConnection
pub fn connection_by_id(&self, id: &str) -> RemoteConnection
Sourcepub fn connection_by_path(&self, path: &str) -> RemoteConnection
pub fn connection_by_path(&self, path: &str) -> RemoteConnection
Returns the NMRemoteConnection representing the connection at @path.
§path
the D-Bus object path of the remote connection
§Returns
the remote connection object on success, or None if the object was
not known
The connection is as received from D-Bus and might not validate according to nm_connection_verify().
Sourcepub fn connection_by_uuid(&self, uuid: &str) -> RemoteConnection
pub fn connection_by_uuid(&self, uuid: &str) -> RemoteConnection
Sourcepub fn connections(&self) -> Vec<RemoteConnection>
pub fn connections(&self) -> Vec<RemoteConnection>
§Returns
an array containing all connections provided by the remote settings service. The returned array is owned by the #NMClient object and should not be modified.
The connections are as received from D-Bus and might not validate according to nm_connection_verify().
Sourcepub fn connectivity(&self) -> ConnectivityState
pub fn connectivity(&self) -> ConnectivityState
Gets the current network connectivity state. Contrast nm_client_check_connectivity() and nm_client_check_connectivity_async(), which re-check the connectivity state first before returning any information.
§Returns
the current connectivity state
Sourcepub fn device_by_iface(&self, iface: &str) -> Device
pub fn device_by_iface(&self, iface: &str) -> Device
Sourcepub fn device_by_path(&self, object_path: &str) -> Device
pub fn device_by_path(&self, object_path: &str) -> Device
Sourcepub fn devices(&self) -> Vec<Device>
pub fn devices(&self) -> Vec<Device>
Gets all the known network devices. Use nm_device_get_type() or the
§Returns
a #GPtrArray containing all the #NMDevices. The returned array is owned by the #NMClient object and should not be modified.
Sourcepub fn dns_configuration(&self) -> Vec<DnsEntry>
Available on crate feature v1_6 only.
pub fn dns_configuration(&self) -> Vec<DnsEntry>
v1_6 only.Sourcepub fn dns_rc_manager(&self) -> GString
Available on crate feature v1_6 only.
pub fn dns_rc_manager(&self) -> GString
v1_6 only.Sourcepub fn logging(&self) -> Result<(Option<GString>, Option<GString>), Error>
pub fn logging(&self) -> Result<(Option<GString>, Option<GString>), Error>
Gets NetworkManager current logging level and domains.
§Deprecated since 1.22
Use the async command nm_client_dbus_call() on DBUS_PATH,
DBUS_INTERFACE to call “GetLogging” with no arguments to get “(ss)” for level
and domains.
§Returns
true on success, false otherwise
§level
return location for logging level string
§domains
return location for log domains string. The string is a list of domains separated by “,”
Sourcepub fn is_nm_running(&self) -> bool
pub fn is_nm_running(&self) -> bool
Sourcepub fn permission_result(
&self,
permission: ClientPermission,
) -> ClientPermissionResult
pub fn permission_result( &self, permission: ClientPermission, ) -> ClientPermissionResult
Sourcepub fn primary_connection(&self) -> ActiveConnection
pub fn primary_connection(&self) -> ActiveConnection
Gets the #NMActiveConnection corresponding to the primary active network device.
In particular, when there is no VPN active, or the VPN does not have the default route, this returns the active connection that has the default route. If there is a VPN active with the default route, then this function returns the active connection that contains the route to the VPN endpoint.
If there is no default route, or the default route is over a
non-NetworkManager-recognized device, this will return None.
§Returns
the appropriate #NMActiveConnection, if any
Sourcepub fn is_startup(&self) -> bool
pub fn is_startup(&self) -> bool
Tests whether the daemon is still in the process of activating connections at startup.
§Returns
whether the daemon is still starting up
Sourcepub fn version_info(&self) -> Vec<u32>
Available on crate feature v1_42 only.
pub fn version_info(&self) -> Vec<u32>
v1_42 only.If available, the first element in the array is NM_VERSION which
encodes the daemon version as “(major << 16 | minor << 8 | micro)”.
The following elements are a bitfield of NMVersionInfoCapability
that indicate that the daemon supports a certain capability.
§Returns
the
list of capabilities reported by the server or None
if the capabilities are unknown.
Sourcepub fn load_connections(
&self,
filenames: &[&str],
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<GString, Error>
pub fn load_connections( &self, filenames: &[&str], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<GString, Error>
Requests that the remote settings service load or reload the given files, adding or updating the connections described within.
The changes to the indicated files will not yet be reflected in @self’s connections array when the function returns.
If all of the indicated files were successfully loaded, the
function will return true, and @failures will be set to None. If
NetworkManager tried to load the files, but some (or all) failed,
then @failures will be set to a None-terminated array of the
filenames that failed to load.
§Deprecated since 1.22
Use nm_client_load_connections_async() or GDBusConnection.
§filenames
None-terminated array of filenames to load
§cancellable
a #GCancellable, or None
§Returns
true on success.
Warning: before libnm 1.22, the boolean return value was inconsistent. That is made worse, because when running against certain server versions before 1.20, the server would return wrong values for success/failure. This means, if you use this function in libnm before 1.22, you are advised to ignore the boolean return value and only look at @failures and @error. With libnm >= 1.22, the boolean return value corresponds to whether @error was set. Note that even in the success case, you might have individual @failures. With 1.22, the return value is consistent with nm_client_load_connections_finish().
§failures
on return, a None-terminated array of
filenames that failed to load
Sourcepub fn load_connections_async<P: FnOnce(Result<Vec<GString>, Error>) + 'static>(
&self,
filenames: &[&str],
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn load_connections_async<P: FnOnce(Result<Vec<GString>, Error>) + 'static>( &self, filenames: &[&str], cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Requests that the remote settings service asynchronously load or reload the given files, adding or updating the connections described within.
See nm_client_load_connections() for more details.
§filenames
None-terminated array of filenames to load
§cancellable
a #GCancellable, or None
§callback
callback to be called when the operation completes
pub fn load_connections_future( &self, filenames: &[&str], ) -> Pin<Box_<dyn Future<Output = Result<Vec<GString>, Error>> + 'static>>
Sourcepub fn networking_get_enabled(&self) -> bool
pub fn networking_get_enabled(&self) -> bool
Sourcepub fn networking_set_enabled(&self, enabled: bool) -> Result<(), Error>
pub fn networking_set_enabled(&self, enabled: bool) -> Result<(), Error>
Enables or disables networking. When networking is disabled, all controlled interfaces are disconnected and deactivated. When networking is enabled, all controlled interfaces are available for activation.
§Deprecated since 1.22
Use the async command nm_client_dbus_call() on DBUS_PATH,
DBUS_INTERFACE to call “Enable” with “(b)” arguments and no return value.
§enabled
true to set networking enabled, false to set networking disabled
§Returns
Sourcepub fn reload_connections(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
pub fn reload_connections( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Requests that the remote settings service reload all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
§Deprecated since 1.22
Use nm_client_reload_connections_async() or GDBusConnection.
§cancellable
a #GCancellable, or None
§Returns
Sourcepub fn reload_connections_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn reload_connections_async<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn reload_connections_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcepub fn save_hostname(
&self,
hostname: Option<&str>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
pub fn save_hostname( &self, hostname: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Requests that the machine’s persistent hostname be set to the specified value or cleared.
§Deprecated since 1.22
Use nm_client_save_hostname_async() or GDBusConnection.
§hostname
the new persistent hostname to set, or None to
clear any existing persistent hostname
§cancellable
a #GCancellable, or None
§Returns
Sourcepub fn save_hostname_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
hostname: Option<&str>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn save_hostname_async<P: FnOnce(Result<(), Error>) + 'static>( &self, hostname: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn save_hostname_future( &self, hostname: Option<&str>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcepub fn set_logging(
&self,
level: Option<&str>,
domains: Option<&str>,
) -> Result<(), Error>
pub fn set_logging( &self, level: Option<&str>, domains: Option<&str>, ) -> Result<(), Error>
Sets NetworkManager logging level and/or domains.
§Deprecated since 1.22
Use the async command nm_client_dbus_call() on DBUS_PATH,
DBUS_INTERFACE to call “SetLogging” with “(ss)” arguments for level and domains.
§level
logging level to set (None or an empty string for no change)
§domains
logging domains to set. The string should be a list of log
domains separated by “,”. (None or an empty string for no change)
§Returns
Sourcepub fn wait_shutdown<P: FnOnce(Result<(), Error>) + 'static>(
&self,
integrate_maincontext: bool,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
Available on crate feature v1_42 only.
pub fn wait_shutdown<P: FnOnce(Result<(), Error>) + 'static>( &self, integrate_maincontext: bool, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
v1_42 only.The way to stop #NMClient is by unrefing it. That will cancel all internally pending async operations. However, as async operations in NMClient use GTask, hence they cannot complete right away. Instead, their (internal) result callback still needs to be dispatched by iterating the client’s main context.
You thus cannot stop iterating the client’s main context until everything is wrapped up. nm_client_get_context_busy_watcher() helps to watch how long that will be.
This function automates that waiting. Like all glib async operations this honors the current g_main_context_get_thread_default().
In any case, to complete the shutdown, nm_client_get_main_context()
must be iterated. If the current g_main_context_get_thread_default() is
the same as nm_client_get_main_context(), then @integrate_maincontext
is ignored. In that case, the caller is required to iterate the context
for shutdown to complete. Otherwise, if g_main_context_get_thread_default()
differs from nm_client_get_main_context() and @integrate_maincontext
is false, the caller must make sure that both contexts are iterated
until completion. Otherwise, if @integrate_maincontext is true, then
nm_client_get_main_context() will be integrated in g_main_context_get_thread_default().
This means, the caller gives nm_client_get_main_context() up until the waiting
completes, the function will acquire the context and hook it into
g_main_context_get_thread_default().
It is a bug to request @integrate_maincontext while having nm_client_get_main_context()
acquired or iterated otherwise because a context can only be acquired once
at a time.
Shutdown can only complete after all references to @self were released.
It is possible to call this function multiple times for the same client. But note that with @integrate_maincontext the client’s context is acquired, which can only be done once at a time.
It is permissible to start waiting before the objects is fully initialized.
The function really allows two separate things. To get a notification (callback) when shutdown is complete, and to integrate the client’s context in another context. The latter case is useful if the client has a separate context and you hand it over to another GMainContext to wrap up.
The main use is to have a NMClient and a separate GMainContext on a worker thread. When being done, you can hand over the cleanup of the context to g_main_context_default(), assuming that the main thread iterates the default context. In that case, you don’t need to care about passing a callback to know when shutdown completed.
§integrate_maincontext
whether to hook the client’s maincontext in the current thread default. Otherwise, you must ensure that the client’s maincontext gets iterated so that it can complete. By integrating the maincontext in the current thread default, you may instead only iterate the latter.
§cancellable
the #GCancellable to abort the shutdown.
§callback
a #GAsyncReadyCallback to call when the request
is satisfied or None if you don’t care about the result of the
method invocation.
pub fn wait_shutdown_future( &self, integrate_maincontext: bool, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
v1_42 only.Sourcepub fn wimax_get_enabled(&self) -> bool
pub fn wimax_get_enabled(&self) -> bool
Sourcepub fn wimax_hardware_get_enabled(&self) -> bool
pub fn wimax_hardware_get_enabled(&self) -> bool
Sourcepub fn wimax_set_enabled(&self, enabled: bool)
pub fn wimax_set_enabled(&self, enabled: bool)
Sourcepub fn wireless_get_enabled(&self) -> bool
pub fn wireless_get_enabled(&self) -> bool
Sourcepub fn wireless_hardware_get_enabled(&self) -> bool
pub fn wireless_hardware_get_enabled(&self) -> bool
Sourcepub fn wireless_set_enabled(&self, enabled: bool)
pub fn wireless_set_enabled(&self, enabled: bool)
Enables or disables wireless devices.
§Deprecated since 1.22
Use the async command nm_client_dbus_set_property() on DBUS_PATH,
DBUS_INTERFACE to set “WirelessEnabled” property to a “(b)” value.
§enabled
true to enable wireless
Sourcepub fn wwan_get_enabled(&self) -> bool
pub fn wwan_get_enabled(&self) -> bool
Sourcepub fn wwan_hardware_get_enabled(&self) -> bool
pub fn wwan_hardware_get_enabled(&self) -> bool
Sourcepub fn wwan_set_enabled(&self, enabled: bool)
pub fn wwan_set_enabled(&self, enabled: bool)
Enables or disables WWAN devices.
§Deprecated since 1.22
Use the async command nm_client_dbus_set_property() on DBUS_PATH,
DBUS_INTERFACE to set “WwanEnabled” property to a “(b)” value.
§enabled
true to enable WWAN
Sourcepub fn can_modify(&self) -> bool
pub fn can_modify(&self) -> bool
If true, adding and modifying connections is supported.
pub fn is_connectivity_check_available(&self) -> bool
pub fn is_connectivity_check_enabled(&self) -> bool
pub fn set_connectivity_check_enabled(&self, connectivity_check_enabled: bool)
Sourcepub fn hostname(&self) -> Option<GString>
pub fn hostname(&self) -> Option<GString>
The machine hostname stored in persistent configuration. This can be modified by calling nm_client_save_hostname().
pub fn metered(&self) -> u32
v1_22 only.Sourcepub fn is_networking_enabled(&self) -> bool
pub fn is_networking_enabled(&self) -> bool
Whether networking is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn set_networking_enabled(&self, networking_enabled: bool)
pub fn set_networking_enabled(&self, networking_enabled: bool)
Whether networking is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn is_wimax_enabled(&self) -> bool
pub fn is_wimax_enabled(&self) -> bool
Whether WiMAX functionality is enabled.
§Deprecated since 1.22
WiMAX is no longer supported and this always returns FALSE. The setter has no effect.
Sourcepub fn set_wimax_enabled(&self, wimax_enabled: bool)
pub fn set_wimax_enabled(&self, wimax_enabled: bool)
Whether WiMAX functionality is enabled.
§Deprecated since 1.22
WiMAX is no longer supported and this always returns FALSE. The setter has no effect.
Sourcepub fn is_wimax_hardware_enabled(&self) -> bool
pub fn is_wimax_hardware_enabled(&self) -> bool
Whether the WiMAX hardware is enabled.
§Deprecated since 1.22
WiMAX is no longer supported and this always returns FALSE.
Sourcepub fn is_wireless_enabled(&self) -> bool
pub fn is_wireless_enabled(&self) -> bool
Whether wireless is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn set_wireless_enabled(&self, wireless_enabled: bool)
pub fn set_wireless_enabled(&self, wireless_enabled: bool)
Whether wireless is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn is_wireless_hardware_enabled(&self) -> bool
pub fn is_wireless_hardware_enabled(&self) -> bool
Whether the wireless hardware is enabled.
Sourcepub fn is_wwan_enabled(&self) -> bool
pub fn is_wwan_enabled(&self) -> bool
Whether WWAN functionality is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn set_wwan_enabled(&self, wwan_enabled: bool)
pub fn set_wwan_enabled(&self, wwan_enabled: bool)
Whether WWAN functionality is enabled.
The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
Sourcepub fn is_wwan_hardware_enabled(&self) -> bool
pub fn is_wwan_hardware_enabled(&self) -> bool
Whether the WWAN hardware is enabled.
Sourcepub fn new_async<P: FnOnce(Result<Client, Error>) + 'static>(
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn new_async<P: FnOnce(Result<Client, Error>) + 'static>( cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Creates a new #NMClient asynchronously. @callback will be called when it is done. Use nm_client_new_finish() to get the result.
This does nothing beside calling g_async_initable_new_async(). You are free to call g_async_initable_new_async() or g_object_new()/g_async_initable_init_async() directly for more control, to set GObject properties or get access to the NMClient instance while it is still initializing.
Creating an #NMClient instance can only fail for two reasons. First, if you didn’t
provide a CLIENT_DBUS_CONNECTION and the call to g_bus_get()
fails. You can avoid that by using g_async_initable_new_async() directly and
set a D-Bus connection.
Second, if you cancelled the creation. If you do that, then note
that after the failure there might still be idle actions pending
which keep nm_client_get_main_context() alive. That means,
in that case you must continue iterating the context to avoid
leaks. See nm_client_get_context_busy_watcher().
Creating an #NMClient instance when NetworkManager is not running does not cause a failure.
§cancellable
a #GCancellable, or None
§callback
callback to call when the client is created
Sourcepub fn new_future() -> Pin<Box_<dyn Future<Output = Result<Client, Error>> + 'static>>
pub fn new_future() -> Pin<Box_<dyn Future<Output = Result<Client, Error>> + 'static>>
Examples found in repository?
16fn main() {
17 let mainloop = glib::MainLoop::new(None, false);
18 mainloop.context().spawn_local(glib::clone!(
19 #[strong]
20 mainloop,
21 async move {
22 let client = match Client::new_future().await {
23 Ok(client) => client,
24 Err(e) => {
25 glib::g_error!("app", "Failed to create new client: {e}");
26 return;
27 }
28 };
29 get_password(&client);
30 mainloop.quit();
31 }
32 ));
33 mainloop.run();
34}More examples
16fn main() {
17 let context = glib::MainContext::new();
18 let mainloop = glib::MainLoop::new(Some(&context), false);
19
20 context.spawn_local(glib::clone!(
21 #[strong]
22 mainloop,
23 async move {
24 let client = match Client::new_future().await {
25 Ok(client) => client,
26 Err(e) => {
27 glib::g_error!("app", "Failed to create new client: {e}");
28 return;
29 }
30 };
31 print_devices(&client);
32 mainloop.quit();
33 }
34 ));
35
36 mainloop.run();
37}Sourcepub fn connect_active_connection_added<F: Fn(&Self, &ActiveConnection) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_active_connection_added<F: Fn(&Self, &ActiveConnection) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcepub fn connect_active_connection_removed<F: Fn(&Self, &ActiveConnection) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_active_connection_removed<F: Fn(&Self, &ActiveConnection) + 'static>( &self, f: F, ) -> SignalHandlerId
Notifies that a #NMActiveConnection has been removed.
§active_connection
the removed active connection
Sourcepub fn connect_any_device_added<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_any_device_added<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Notifies that a #NMDevice is added. This signal is emitted for both regular devices and placeholder devices.
§device
the new device
Sourcepub fn connect_any_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_any_device_removed<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Notifies that a #NMDevice is removed. This signal is emitted for both regular devices and placeholder devices.
§device
the removed device
Sourcepub fn connect_connection_added<F: Fn(&Self, &RemoteConnection) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_connection_added<F: Fn(&Self, &RemoteConnection) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcepub fn connect_connection_removed<F: Fn(&Self, &RemoteConnection) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_connection_removed<F: Fn(&Self, &RemoteConnection) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcepub fn connect_device_added<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_device_added<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Notifies that a #NMDevice is added. This signal is not emitted for placeholder devices.
§device
the new device
Sourcepub fn connect_device_removed<F: Fn(&Self, &Device) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_device_removed<F: Fn(&Self, &Device) + 'static>( &self, f: F, ) -> SignalHandlerId
Notifies that a #NMDevice is removed. This signal is not emitted for placeholder devices.
§device
the removed device
Sourcepub fn connect_permission_changed<F: Fn(&Self, u32, u32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
pub fn connect_permission_changed<F: Fn(&Self, u32, u32) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_activating_connection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_active_connections_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_all_devices_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_2 only.pub fn connect_can_modify_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_checkpoints_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_12 only.pub fn connect_connections_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_connectivity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_connectivity_check_available_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_connectivity_check_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_devices_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_dns_configuration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_6 only.pub fn connect_dns_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_6 only.pub fn connect_dns_rc_manager_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_6 only.pub fn connect_hostname_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_metered_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_2 only.pub fn connect_networking_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_nm_running_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_primary_connection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_startup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_state_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_version_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_version_info_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_42 only.pub fn connect_wimax_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_wimax_hardware_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_wireless_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_wireless_hardware_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_wwan_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_wwan_hardware_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Trait Implementations§
Source§impl HasParamSpec for Client
impl HasParamSpec for Client
Source§impl Ord for Client
impl Ord for Client
Source§fn cmp(&self, other: &Self) -> Ordering
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) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<OT: ObjectType> PartialEq<OT> for Client
impl<OT: ObjectType> PartialEq<OT> for Client
Source§impl<OT: ObjectType> PartialOrd<OT> for Client
impl<OT: ObjectType> PartialOrd<OT> for Client
Source§impl StaticType for Client
impl StaticType for Client
Source§fn static_type() -> Type
fn static_type() -> Type
Self.impl Eq for Client
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
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 moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
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 moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true if the object is an instance of (can be cast to) T.Source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass of the object. Read moreSource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T. Read moreSource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T of the object. Read moreSource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name of the object and cast it to the type V. Read moreSource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name of the object. Read moreSource§fn has_property(&self, property_name: &str) -> bool
fn has_property(&self, property_name: &str) -> bool
property_name.Source§fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
property_name of the given type_.Source§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name of this object. Read moreSource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec of the property property_name of this object.Source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec of the properties of this object.Source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key. Read moreSource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key. Read moreSource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
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]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit but takes Value for the arguments.Source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
Source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify signal of the object. Read more