Rename Connection to ActiveConnection

This commit is contained in:
Lucy 2022-01-12 11:09:03 -05:00
parent e40c3e7787
commit 0168219a78
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
2 changed files with 8 additions and 8 deletions

View file

@ -13,9 +13,9 @@ use crate::{
use std::ops::Deref;
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>>> {
let devices = self.0.devices().await?;
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>;
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 {
Connection(connection)
ActiveConnection(connection)
}
}

View file

@ -6,7 +6,7 @@ pub mod wireless;
use crate::{
config::{ip4::Ipv4Config, ip6::Ipv6Config},
connection::Connection,
connection::ActiveConnection,
interface::{
config::{ip4::Ipv4ConfigProxy, ip6::Ipv6ConfigProxy},
connection::ActiveConnectionProxy,
@ -23,7 +23,7 @@ use zbus::Result;
pub struct Device<'a>(DeviceProxy<'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?;
Ok(ActiveConnectionProxy::builder(self.0.connection())
.path(active_connection)?
@ -32,7 +32,7 @@ impl<'a> Device<'a> {
.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 mut out = Vec::with_capacity(available_connections.len());
for connection in available_connections {