Rename Connection to ActiveConnection
This commit is contained in:
parent
e40c3e7787
commit
0168219a78
2 changed files with 8 additions and 8 deletions
|
|
@ -13,9 +13,9 @@ use crate::{
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use zbus::Result;
|
use zbus::Result;
|
||||||
|
|
||||||
pub struct Connection<'a>(ActiveConnectionProxy<'a>);
|
pub struct ActiveConnection<'a>(ActiveConnectionProxy<'a>);
|
||||||
|
|
||||||
impl<'a> Connection<'a> {
|
impl<'a> ActiveConnection<'a> {
|
||||||
pub async fn devices(&self) -> Result<Vec<Device<'a>>> {
|
pub async fn devices(&self) -> Result<Vec<Device<'a>>> {
|
||||||
let devices = self.0.devices().await?;
|
let devices = self.0.devices().await?;
|
||||||
let mut out = Vec::with_capacity(devices.len());
|
let mut out = Vec::with_capacity(devices.len());
|
||||||
|
|
@ -57,7 +57,7 @@ impl<'a> Connection<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Deref for Connection<'a> {
|
impl<'a> Deref for ActiveConnection<'a> {
|
||||||
type Target = ActiveConnectionProxy<'a>;
|
type Target = ActiveConnectionProxy<'a>;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
|
|
@ -65,8 +65,8 @@ impl<'a> Deref for Connection<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> From<ActiveConnectionProxy<'a>> for Connection<'a> {
|
impl<'a> From<ActiveConnectionProxy<'a>> for ActiveConnection<'a> {
|
||||||
fn from(connection: ActiveConnectionProxy<'a>) -> Self {
|
fn from(connection: ActiveConnectionProxy<'a>) -> Self {
|
||||||
Connection(connection)
|
ActiveConnection(connection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ pub mod wireless;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::{ip4::Ipv4Config, ip6::Ipv6Config},
|
config::{ip4::Ipv4Config, ip6::Ipv6Config},
|
||||||
connection::Connection,
|
connection::ActiveConnection,
|
||||||
interface::{
|
interface::{
|
||||||
config::{ip4::Ipv4ConfigProxy, ip6::Ipv6ConfigProxy},
|
config::{ip4::Ipv4ConfigProxy, ip6::Ipv6ConfigProxy},
|
||||||
connection::ActiveConnectionProxy,
|
connection::ActiveConnectionProxy,
|
||||||
|
|
@ -23,7 +23,7 @@ use zbus::Result;
|
||||||
pub struct Device<'a>(DeviceProxy<'a>);
|
pub struct Device<'a>(DeviceProxy<'a>);
|
||||||
|
|
||||||
impl<'a> Device<'a> {
|
impl<'a> Device<'a> {
|
||||||
pub async fn active_connection(&self) -> Result<Connection<'a>> {
|
pub async fn active_connection(&self) -> Result<ActiveConnection<'a>> {
|
||||||
let active_connection = self.0.active_connection().await?;
|
let active_connection = self.0.active_connection().await?;
|
||||||
Ok(ActiveConnectionProxy::builder(self.0.connection())
|
Ok(ActiveConnectionProxy::builder(self.0.connection())
|
||||||
.path(active_connection)?
|
.path(active_connection)?
|
||||||
|
|
@ -32,7 +32,7 @@ impl<'a> Device<'a> {
|
||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn available_connections(&self) -> Result<Vec<Connection<'a>>> {
|
pub async fn available_connections(&self) -> Result<Vec<ActiveConnection<'a>>> {
|
||||||
let available_connections = self.0.available_connections().await?;
|
let available_connections = self.0.available_connections().await?;
|
||||||
let mut out = Vec::with_capacity(available_connections.len());
|
let mut out = Vec::with_capacity(available_connections.len());
|
||||||
for connection in available_connections {
|
for connection in available_connections {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue