feat: zbus 4.2.1 update

This commit is contained in:
Ashley Wulber 2024-05-16 15:24:53 -04:00 committed by GitHub
parent ce9c789fe6
commit f05789c4ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 390 additions and 389 deletions

View file

@ -28,7 +28,7 @@ pub struct Device<'a>(DeviceProxy<'a>);
impl<'a> Device<'a> {
pub async fn active_connection(&self) -> Result<ActiveConnection<'a>> {
let active_connection = self.0.active_connection().await?;
Ok(ActiveConnectionProxy::builder(self.0.connection())
Ok(ActiveConnectionProxy::builder(self.0.inner().connection())
.path(active_connection)?
.build()
.await?
@ -39,7 +39,7 @@ impl<'a> Device<'a> {
let available_connections = self.0.available_connections().await?;
let mut out = Vec::with_capacity(available_connections.len());
for connection in available_connections {
let connection = ActiveConnectionProxy::builder(self.0.connection())
let connection = ActiveConnectionProxy::builder(self.0.inner().connection())
.path(connection)?
.build()
.await?;
@ -62,36 +62,36 @@ impl<'a> Device<'a> {
pub async fn downcast_to_device(&'a self) -> Result<Option<SpecificDevice<'a>>> {
match self.device_type().await? {
DeviceType::Bluetooth => Ok(Some(SpecificDevice::Bluetooth(
BluetoothDeviceProxy::builder(self.0.connection())
.path(self.0.path())?
BluetoothDeviceProxy::builder(self.0.inner().connection())
.path(self.0.inner().path())?
.build()
.await?
.into(),
))),
DeviceType::Ethernet => Ok(Some(SpecificDevice::Wired(
WiredDeviceProxy::builder(self.0.connection())
.path(self.0.path())?
WiredDeviceProxy::builder(self.0.inner().connection())
.path(self.0.inner().path())?
.build()
.await?
.into(),
))),
DeviceType::Wifi => Ok(Some(SpecificDevice::Wireless(
WirelessDeviceProxy::builder(self.0.connection())
.path(self.0.path())?
WirelessDeviceProxy::builder(self.0.inner().connection())
.path(self.0.inner().path())?
.build()
.await?
.into(),
))),
DeviceType::TunTap => Ok(Some(SpecificDevice::TunTap(
TunDeviceProxy::builder(self.0.connection())
.path(self.0.path())?
TunDeviceProxy::builder(self.0.inner().connection())
.path(self.0.inner().path())?
.build()
.await?
.into(),
))),
DeviceType::WireGuard => Ok(Some(SpecificDevice::WireGuard(
WireGuardDeviceProxy::builder(self.0.connection())
.path(self.0.path())?
WireGuardDeviceProxy::builder(self.0.inner().connection())
.path(self.0.inner().path())?
.build()
.await?
.into(),
@ -105,7 +105,7 @@ impl<'a> Device<'a> {
}
pub async fn ip4_config(&self) -> Result<Ipv4Config<'a>> {
let config = Ipv4ConfigProxy::builder(self.0.connection())
let config = Ipv4ConfigProxy::builder(self.0.inner().connection())
.path(self.0.ip4_config().await?)?
.build()
.await?;
@ -113,7 +113,7 @@ impl<'a> Device<'a> {
}
pub async fn ip6_config(&self) -> Result<Ipv6Config<'a>> {
let config = Ipv6ConfigProxy::builder(self.0.connection())
let config = Ipv6ConfigProxy::builder(self.0.inner().connection())
.path(self.0.ip6_config().await?)?
.build()
.await?;