improv(network-manager): add NetworkManager::activate_connection_by_paths
Useful when you have the paths, but not the zbus objects
This commit is contained in:
parent
64f4000374
commit
7aedc25e32
1 changed files with 12 additions and 2 deletions
|
|
@ -30,13 +30,23 @@ impl<'a> NetworkManager<'a> {
|
|||
NetworkManagerProxy::new(connection).await.map(Self)
|
||||
}
|
||||
|
||||
/// Activate a connection profile for the given device.
|
||||
pub async fn activate_connection(
|
||||
&self,
|
||||
connection: &'a Connection<'a>,
|
||||
device: &'a Device<'a>,
|
||||
connection: &Connection<'_>,
|
||||
device: &Device<'_>,
|
||||
) -> Result<ActiveConnection<'a>> {
|
||||
let connection = connection.inner().path();
|
||||
let device = device.inner().path();
|
||||
self.activate_connection_by_paths(connection, device).await
|
||||
}
|
||||
|
||||
/// Activate a connection profile for the given device by their object paths.
|
||||
pub async fn activate_connection_by_paths(
|
||||
&self,
|
||||
connection: &ObjectPath<'_>,
|
||||
device: &ObjectPath<'_>,
|
||||
) -> Result<ActiveConnection<'a>> {
|
||||
let specific_object = ObjectPath::from_static_str("/").unwrap();
|
||||
let active_connection_path = self
|
||||
.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue