From 5b51a2dcc04d5195d3e9a1663269f02980de4956 Mon Sep 17 00:00:00 2001 From: Cristian Filipescu Date: Sun, 25 Oct 2026 23:23:21 -0400 Subject: [PATCH 1/2] feat: migrate NetworkManager proxies to zbus 6 --- .github/workflows/ci.yml | 16 +- Cargo.lock | 658 ++++++--------------- Cargo.toml | 5 +- README.md | 18 +- examples/add_connection.rs | 41 +- examples/show_wifi_networks.rs | 2 +- examples/wifi_access_points.rs | 4 +- examples/wifi_active_ap.rs | 2 +- src/network_manager.rs | 74 ++- src/network_manager/access_point.rs | 4 +- src/network_manager/active.rs | 22 +- src/network_manager/adsl.rs | 4 +- src/network_manager/agent_manager.rs | 4 +- src/network_manager/bluetooth.rs | 4 +- src/network_manager/bond.rs | 6 +- src/network_manager/bridge.rs | 6 +- src/network_manager/checkpoint.rs | 6 +- src/network_manager/connection.rs | 4 +- src/network_manager/device.rs | 27 +- src/network_manager/dhcp4config.rs | 8 +- src/network_manager/dhcp6config.rs | 8 +- src/network_manager/dns_manager.rs | 6 +- src/network_manager/dummy.rs | 4 +- src/network_manager/generic.rs | 4 +- src/network_manager/hsr.rs | 8 +- src/network_manager/infiniband.rs | 4 +- src/network_manager/ip4config.rs | 10 +- src/network_manager/ip6config.rs | 8 +- src/network_manager/iptunnel.rs | 6 +- src/network_manager/loopback.rs | 4 +- src/network_manager/lowpan.rs | 6 +- src/network_manager/macsec.rs | 6 +- src/network_manager/macvlan.rs | 6 +- src/network_manager/modem.rs | 4 +- src/network_manager/nsp.rs | 4 +- src/network_manager/olpc_mesh.rs | 6 +- src/network_manager/ovs_bridge.rs | 6 +- src/network_manager/ovs_interface.rs | 4 +- src/network_manager/ovs_port.rs | 6 +- src/network_manager/plugin.rs | 26 +- src/network_manager/ppp.rs | 8 +- src/network_manager/secret_agent.rs | 23 +- src/network_manager/settings.rs | 30 +- src/network_manager/settings_connection.rs | 24 +- src/network_manager/statistics.rs | 4 +- src/network_manager/team.rs | 6 +- src/network_manager/tun.rs | 4 +- src/network_manager/veth.rs | 6 +- src/network_manager/vlan.rs | 6 +- src/network_manager/vrf.rs | 4 +- src/network_manager/vxlan.rs | 6 +- src/network_manager/wi_max.rs | 14 +- src/network_manager/wifi_p2p.rs | 12 +- src/network_manager/wifi_p2ppeer.rs | 4 +- src/network_manager/wire_guard.rs | 4 +- src/network_manager/wired.rs | 4 +- src/network_manager/wireless.rs | 21 +- src/network_manager/wpan.rs | 4 +- tests/zbus6.rs | 104 ++++ 59 files changed, 578 insertions(+), 761 deletions(-) create mode 100644 tests/zbus6.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b0096b..47b67f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: rust: - - 1.87.0 + - 1.89.0 - stable - beta # - nightly @@ -35,20 +35,22 @@ jobs: toolchain: ${{ matrix.rust }} - uses: swatinem/rust-cache@v2 - name: cargo-check - run: cargo check --locked + run: | + cargo check --all-targets --all-features --locked + cargo check --no-default-features --lib --locked fmt: name: format runs-on: ubuntu-latest env: - RUSTUP_TOOLCHAIN: 1.87.0 + RUSTUP_TOOLCHAIN: 1.89.0 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.87.0 + toolchain: 1.89.0 components: rustfmt - name: cargo-fmt run: cargo fmt -- --check @@ -59,7 +61,7 @@ jobs: strategy: matrix: rust: - - 1.87.0 + - 1.89.0 - stable - beta # - nightly @@ -82,13 +84,13 @@ jobs: runs-on: ubuntu-latest env: - RUSTUP_TOOLCHAIN: 1.87.0 + RUSTUP_TOOLCHAIN: 1.89.0 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.87.0 + toolchain: 1.89.0 components: clippy - uses: swatinem/rust-cache@v2 - name: cargo-clippy diff --git a/Cargo.lock b/Cargo.lock index ab8a0d5..87e67b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "aho-corasick" version = "1.1.3" @@ -26,128 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "async-broadcast" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" -dependencies = [ - "event-listener", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "pin-project-lite", - "slab", -] - -[[package]] -name = "async-io" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" -dependencies = [ - "async-lock", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix 0.38.44", - "slab", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" -dependencies = [ - "async-channel", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if", - "event-listener", - "futures-lite", - "rustix 0.38.44", - "tracing", -] - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "async-signal" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.44", - "signal-hook-registry", - "slab", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.88" @@ -156,36 +19,15 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -203,27 +45,20 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 2.0.101", ] [[package]] name = "bitflags" -version = "2.9.4" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] -name = "blocking" -version = "1.6.1" +name = "bumpalo" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite", - "piper", -] +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytes" @@ -246,12 +81,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "clang-sys" version = "1.8.1" @@ -263,21 +92,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - [[package]] name = "either" version = "1.15.0" @@ -290,27 +104,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" -[[package]] -name = "enumflags2" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -327,27 +120,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "event-listener" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -356,27 +128,32 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-task" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] -name = "futures-lite" -version = "2.6.0" +name = "futures-util" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ - "fastrand", "futures-core", - "futures-io", - "parking", + "futures-task", "pin-project-lite", + "slab", ] [[package]] @@ -391,12 +168,6 @@ dependencies = [ "wasi 0.14.2+wasi-0.2.4", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "glob" version = "0.3.2" @@ -409,12 +180,6 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -432,30 +197,30 @@ dependencies = [ ] [[package]] -name = "io-uring" -version = "0.7.10" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "bitflags", - "cfg-if", - "libc", + "either", ] [[package]] -name = "itertools" -version = "0.13.0" +name = "js-sys" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" dependencies = [ - "either", + "cfg-if", + "futures-util", + "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.172" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libloading" @@ -464,20 +229,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.53.4", ] [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "lock_api" @@ -516,37 +275,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" -dependencies = [ - "adler2", -] - [[package]] name = "mio" -version = "1.0.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags", - "cfg-if", - "cfg_aliases", - "libc", - "memoffset", + "windows-sys 0.61.2", ] [[package]] @@ -578,16 +315,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", + "syn 2.0.101", ] [[package]] @@ -606,12 +334,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - [[package]] name = "parking_lot" version = "0.12.3" @@ -641,32 +363,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" -[[package]] -name = "piper" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - -[[package]] -name = "polling" -version = "3.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix 0.38.44", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "prettyplease" version = "0.2.32" @@ -674,7 +370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.101", ] [[package]] @@ -748,12 +444,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -762,28 +452,15 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustix" -version = "1.0.7" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.59.0", + "linux-raw-sys", + "windows-sys 0.60.2", ] [[package]] @@ -827,7 +504,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -838,7 +515,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -873,25 +550,30 @@ checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "socket2" -version = "0.6.0" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "syn" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "2.0.101" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -907,39 +589,37 @@ dependencies = [ "fastrand", "getrandom", "once_cell", - "rustix 1.0.7", + "rustix", "windows-sys 0.59.0", ] [[package]] name = "tokio" -version = "1.47.1" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", "socket2", "tokio-macros", - "windows-sys 0.59.0", + "tracing", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.9", ] [[package]] @@ -967,14 +647,14 @@ checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.7.10", ] [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -983,20 +663,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", ] @@ -1018,6 +698,18 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "uuid" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +dependencies = [ + "getrandom", + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1033,6 +725,51 @@ dependencies = [ "wit-bindgen-rt", ] +[[package]] +name = "wasm-bindgen" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.9", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1057,35 +794,35 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.4", ] [[package]] name = "windows-sys" -version = "0.60.2" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-targets 0.53.4", + "windows-link", ] [[package]] @@ -1226,6 +963,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -1237,101 +983,77 @@ dependencies = [ [[package]] name = "zbus" -version = "5.11.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d07e46d035fb8e375b2ce63ba4e4ff90a7f73cf2ffb0138b29e1158d2eaadf7" +checksum = "fcff5faa63a63d5b81051740f7382017f10b3440b3f401d97f0cf0b3b39c62d9" dependencies = [ - "async-broadcast", - "async-executor", - "async-io", - "async-lock", - "async-process", - "async-recursion", - "async-task", "async-trait", - "blocking", - "enumflags2", - "event-listener", + "bitflags", + "endi", "futures-core", - "futures-lite", "hex", - "nix", + "libc", "ordered-stream", + "rustix", "serde", "serde_repr", + "socket2", + "tokio", "tracing", "uds_windows", - "windows-sys 0.60.2", - "winnow", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.4", "zbus_macros", - "zbus_names", - "zvariant", + "zbus_utils", + "zcheapstr", + "zruntime", ] [[package]] name = "zbus_macros" -version = "5.11.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e797a9c847ed3ccc5b6254e8bcce056494b375b511b3d6edcec0aeb4defaca" +checksum = "5bba6e2bfe19571dc81b3e0be9f8daec6e5422db3e2eea2e766a859553e7bd37" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn", - "zbus_names", - "zvariant", - "zvariant_utils", + "syn 3.0.9", + "zbus_utils", ] [[package]] -name = "zbus_names" -version = "4.2.0" +name = "zbus_utils" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" +checksum = "c27a055b114bd9fc3686e90f62bd1fe612d523fc5f620bac3b1d2f42d3f6cab8" dependencies = [ + "proc-macro2", + "quote", "serde", - "static_assertions", - "winnow", - "zvariant", + "syn 3.0.9", + "winnow 1.0.4", ] [[package]] -name = "zvariant" -version = "5.5.3" +name = "zcheapstr" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d30786f75e393ee63a21de4f9074d4c038d52c5b1bb4471f955db249f9dffb1" +checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473" dependencies = [ - "endi", - "enumflags2", "serde", - "winnow", - "zvariant_derive", - "zvariant_utils", ] [[package]] -name = "zvariant_derive" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75fda702cd42d735ccd48117b1630432219c0e9616bf6cb0f8350844ee4d9580" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "3.2.0" +name = "zruntime" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16edfee43e5d7b553b77872d99bc36afdda75c223ca7ad5e3fbecd82ca5fc34" +checksum = "dfc035df602243402949ddf3dcc5bcfad7edeb732dd49ec6e605431c4eca54ce" dependencies = [ - "proc-macro2", - "quote", - "serde", - "static_assertions", - "syn", - "winnow", + "futures-core", + "futures-io", + "rustix", + "socket2", + "tracing", + "windows-sys 0.61.2", ] diff --git a/Cargo.toml b/Cargo.toml index 8f08a0b..fca48fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "rusty_network_manager" description = "A crate for interacting with network_manager using zbus" version = "0.7.1" edition = "2024" +rust-version = "1.89" license = "MIT" homepage = "https://github.com/KevinVoell/network_manager" repository = "https://github.com/KevinVoell/network_manager" @@ -13,7 +14,7 @@ categories = [] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -zbus = "5.11.0" +zbus = "6.1.0" bitflags = "2.9.4" num_enum = "0.7.4" @@ -23,7 +24,7 @@ bindgen = "0.72.1" [dev-dependencies] tokio = { version = "1.47.1", features = ["full"] } tokio-stream = "0.1.17" -zbus = "5.7.0" +zbus = { version = "6.1.0", features = ["p2p"] } [features] default = ["full"] diff --git a/README.md b/README.md index 2473a48..63de028 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ through NetworkManager. ## Prerequisites Before you can use this project, ensure you have the following installed: -- Rust and Cargo (latest stable version recommended) +- Rust 1.89 or newer and Cargo - NetworkManager on your Linux distribution ## Installation @@ -43,6 +43,22 @@ To use this project, follow these steps: This section provides basic examples of how to use the project to interact with NetworkManager through zbus. +### Migrating to zbus 6 + +This crate uses zbus 6. Applications that pass a `zbus::Connection` or other +zbus types to these proxies must also use zbus 6. + +- Use `zbus::ObjectPath` and `zbus::OwnedObjectPath` for object paths. +- Replace `zbus::zvariant::Value` and `OwnedValue` with `zbus::Variant` and + `zbus::OwnedVariant` for connection settings and other variant values. +- Proxy builder setters such as `.path(...)` now return the builder directly; + errors are reported by `.build().await`. +- Generated blocking proxies are no longer available. Use the async proxies, + or drive an async operation with `zbus::block_on`. + +See the [zbus 6 migration guide](https://z-galaxy.github.io/zbus/upgrading-to-6.html) +for the full list of upstream changes. + ## Contributing We welcome contributions! Please open an issue or submit a pull request for any diff --git a/examples/add_connection.rs b/examples/add_connection.rs index 5669448..5cb8a03 100644 --- a/examples/add_connection.rs +++ b/examples/add_connection.rs @@ -17,7 +17,7 @@ use rusty_network_manager::NetworkManagerProxy; use std::collections::HashMap; use std::env; use zbus::Connection; -use zbus::zvariant::Value; +use zbus::Variant; #[tokio::main] async fn main() { @@ -29,7 +29,7 @@ async fn main() { .await .expect("Could not get NetworkManager"); - let wireless_interface_path: zbus::zvariant::OwnedObjectPath = nm + let wireless_interface_path: zbus::OwnedObjectPath = nm .get_device_by_ip_iface("wlan0") .await .expect("Could not get wireless interface"); @@ -39,10 +39,7 @@ async fn main() { }; } -async fn connect( - nm: &NetworkManagerProxy<'_>, - wireless_interface_path: zbus::zvariant::OwnedObjectPath, -) { +async fn connect(nm: &NetworkManagerProxy<'_>, wireless_interface_path: zbus::OwnedObjectPath) { let args: Vec = env::args().collect(); if args.len() != 4 { @@ -55,34 +52,34 @@ async fn connect( let ssid = &args[2]; let psk = &args[3]; - let mut connection_settings: HashMap<&str, HashMap<&str, Value<'_>>> = HashMap::new(); + let mut connection_settings: HashMap<&str, HashMap<&str, Variant<'_>>> = HashMap::new(); - let mut connection: HashMap<&str, Value<'_>> = HashMap::new(); - connection.insert("id", Value::new(connection_name)); - connection.insert("type", Value::new("802-11-wireless")); - connection.insert("autoconnect", Value::new(true)); + let mut connection: HashMap<&str, Variant<'_>> = HashMap::new(); + connection.insert("id", Variant::new(connection_name)); + connection.insert("type", Variant::new("802-11-wireless")); + connection.insert("autoconnect", Variant::new(true)); connection_settings.insert("connection", connection); - let mut wireless80211: HashMap<&str, Value<'_>> = HashMap::new(); + let mut wireless80211: HashMap<&str, Variant<'_>> = HashMap::new(); // SSID must be a Vec - wireless80211.insert("ssid", Value::new(ssid.as_bytes())); - wireless80211.insert("mode", Value::new("infrastructure")); + wireless80211.insert("ssid", Variant::new(ssid.as_bytes())); + wireless80211.insert("mode", Variant::new("infrastructure")); connection_settings.insert("802-11-wireless", wireless80211); - let mut wireless_security: HashMap<&str, Value<'_>> = HashMap::new(); - wireless_security.insert("key-mgmt", Value::new("wpa-psk")); - wireless_security.insert("psk", Value::new(psk)); + let mut wireless_security: HashMap<&str, Variant<'_>> = HashMap::new(); + wireless_security.insert("key-mgmt", Variant::new("wpa-psk")); + wireless_security.insert("psk", Variant::new(psk)); connection_settings.insert("802-11-wireless-security", wireless_security); - let mut ipv4: HashMap<&str, Value<'_>> = HashMap::new(); - ipv4.insert("method", Value::new("auto")); + let mut ipv4: HashMap<&str, Variant<'_>> = HashMap::new(); + ipv4.insert("method", Variant::new("auto")); connection_settings.insert("ipv4", ipv4); - let mut ipv6: HashMap<&str, Value<'_>> = HashMap::new(); - ipv6.insert("method", Value::new("auto")); + let mut ipv6: HashMap<&str, Variant<'_>> = HashMap::new(); + ipv6.insert("method", Variant::new("auto")); connection_settings.insert("ipv6", ipv6); - let specific_object = zbus::zvariant::OwnedObjectPath::try_from("/").unwrap(); + let specific_object = zbus::OwnedObjectPath::try_from("/").unwrap(); nm.add_and_activate_connection( connection_settings, diff --git a/examples/show_wifi_networks.rs b/examples/show_wifi_networks.rs index fe77497..9bb5e65 100644 --- a/examples/show_wifi_networks.rs +++ b/examples/show_wifi_networks.rs @@ -23,7 +23,7 @@ use std::fs::File; use std::io::Read; use std::time::Duration; use zbus::Connection; -use zbus::zvariant::OwnedObjectPath; +use zbus::OwnedObjectPath; const SCAN_THRESHOLD_MSEC: u128 = 10_000; diff --git a/examples/wifi_access_points.rs b/examples/wifi_access_points.rs index e6c9b45..c12c1c0 100644 --- a/examples/wifi_access_points.rs +++ b/examples/wifi_access_points.rs @@ -65,7 +65,7 @@ async fn monitor_add_access_point(wireless_proxy: &WirelessProxy<'_>, connection while let Some(v) = access_points_changed.next().await { let args = v.args().unwrap(); - let owned_object_path = zbus::zvariant::OwnedObjectPath::from(args.access_point); + let owned_object_path = zbus::OwnedObjectPath::from(args.access_point); let access_point = AccessPointProxy::new_from_path(owned_object_path, connection) .await @@ -85,7 +85,7 @@ async fn monitor_remove_access_point(wireless_proxy: &WirelessProxy<'_>, connect while let Some(v) = access_points_changed.next().await { let args = v.args().unwrap(); - let owned_object_path = zbus::zvariant::OwnedObjectPath::from(args.access_point); + let owned_object_path = zbus::OwnedObjectPath::from(args.access_point); let access_point = AccessPointProxy::new_from_path(owned_object_path, connection) .await diff --git a/examples/wifi_active_ap.rs b/examples/wifi_active_ap.rs index 3b86fbf..c6fe687 100644 --- a/examples/wifi_active_ap.rs +++ b/examples/wifi_active_ap.rs @@ -30,7 +30,7 @@ async fn main() { .await .expect("Could not get NetworkManager"); - //let settings_path = zbus::zvariant::OwnedObjectPath::try_from("org.freedesktop.NetworkManager.Settings".to_string()); + //let settings_path = zbus::OwnedObjectPath::try_from("org.freedesktop.NetworkManager.Settings".to_string()); //let settings_proxy = SettingsProxy::new_from_path(settings_path.unwrap(), &connection); let args: Vec = env::args().collect(); diff --git a/src/network_manager.rs b/src/network_manager.rs index dd64abc..b4d5a0d 100644 --- a/src/network_manager.rs +++ b/src/network_manager.rs @@ -132,24 +132,21 @@ pub trait NetworkManager { /// ActivateConnection method fn activate_connection( &self, - connection: &zbus::zvariant::ObjectPath<'_>, - device: &zbus::zvariant::ObjectPath<'_>, - specific_object: &zbus::zvariant::ObjectPath<'_>, - ) -> zbus::Result; + connection: &zbus::ObjectPath<'_>, + device: &zbus::ObjectPath<'_>, + specific_object: &zbus::ObjectPath<'_>, + ) -> zbus::Result; /// AddAndActivateConnection method fn add_and_activate_connection( &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - device: &zbus::zvariant::ObjectPath<'_>, - specific_object: &zbus::zvariant::ObjectPath<'_>, - ) -> zbus::Result<( - zbus::zvariant::OwnedObjectPath, - zbus::zvariant::OwnedObjectPath, - )>; + device: &zbus::ObjectPath<'_>, + specific_object: &zbus::ObjectPath<'_>, + ) -> zbus::Result<(zbus::OwnedObjectPath, zbus::OwnedObjectPath)>; /// AddAndActivateConnection2 method #[allow(clippy::too_many_arguments)] @@ -157,15 +154,15 @@ pub trait NetworkManager { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - device: &zbus::zvariant::ObjectPath<'_>, - specific_object: &zbus::zvariant::ObjectPath<'_>, - options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + device: &zbus::ObjectPath<'_>, + specific_object: &zbus::ObjectPath<'_>, + options: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<( - zbus::zvariant::OwnedObjectPath, - zbus::zvariant::OwnedObjectPath, - std::collections::HashMap, + zbus::OwnedObjectPath, + zbus::OwnedObjectPath, + std::collections::HashMap, )>; /// CheckConnectivity method @@ -174,44 +171,41 @@ pub trait NetworkManager { /// CheckpointAdjustRollbackTimeout method fn checkpoint_adjust_rollback_timeout( &self, - checkpoint: &zbus::zvariant::ObjectPath<'_>, + checkpoint: &zbus::ObjectPath<'_>, add_timeout: u32, ) -> zbus::Result<()>; /// CheckpointCreate method fn checkpoint_create( &self, - devices: &[zbus::zvariant::ObjectPath<'_>], + devices: &[zbus::ObjectPath<'_>], rollback_timeout: u32, flags: u32, - ) -> zbus::Result; + ) -> zbus::Result; /// CheckpointDestroy method - fn checkpoint_destroy(&self, checkpoint: &zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn checkpoint_destroy(&self, checkpoint: &zbus::ObjectPath<'_>) -> zbus::Result<()>; /// CheckpointRollback method fn checkpoint_rollback( &self, - checkpoint: &zbus::zvariant::ObjectPath<'_>, + checkpoint: &zbus::ObjectPath<'_>, ) -> zbus::Result>; /// DeactivateConnection method - fn deactivate_connection( - &self, - active_connection: &zbus::zvariant::ObjectPath<'_>, - ) -> zbus::Result<()>; + fn deactivate_connection(&self, active_connection: &zbus::ObjectPath<'_>) -> zbus::Result<()>; /// Enable method fn enable(&self, enable: bool) -> zbus::Result<()>; /// GetAllDevices method - fn get_all_devices(&self) -> zbus::Result>; + fn get_all_devices(&self) -> zbus::Result>; /// GetDeviceByIpIface method - fn get_device_by_ip_iface(&self, iface: &str) -> zbus::Result; + fn get_device_by_ip_iface(&self, iface: &str) -> zbus::Result; /// GetDevices method - fn get_devices(&self) -> zbus::Result>; + fn get_devices(&self) -> zbus::Result>; /// GetLogging method fn get_logging(&self) -> zbus::Result<(String, String)>; @@ -238,11 +232,11 @@ pub trait NetworkManager { /// DeviceAdded signal #[zbus(signal)] - fn device_added(&self, device_path: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn device_added(&self, device_path: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// DeviceRemoved signal #[zbus(signal)] - fn device_removed(&self, device_path: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn device_removed(&self, device_path: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// StateChanged signal #[zbus(signal)] @@ -250,15 +244,15 @@ pub trait NetworkManager { /// ActivatingConnection property #[zbus(property)] - fn activating_connection(&self) -> zbus::Result; + fn activating_connection(&self) -> zbus::Result; /// ActiveConnections property #[zbus(property)] - fn active_connections(&self) -> zbus::Result>; + fn active_connections(&self) -> zbus::Result>; /// AllDevices property #[zbus(property)] - fn all_devices(&self) -> zbus::Result>; + fn all_devices(&self) -> zbus::Result>; /// Capabilities property #[zbus(property)] @@ -266,7 +260,7 @@ pub trait NetworkManager { /// Checkpoints property #[zbus(property)] - fn checkpoints(&self) -> zbus::Result>; + fn checkpoints(&self) -> zbus::Result>; /// Connectivity property #[zbus(property)] @@ -288,17 +282,17 @@ pub trait NetworkManager { /// Devices property #[zbus(property)] - fn devices(&self) -> zbus::Result>; + fn devices(&self) -> zbus::Result>; /// GlobalDnsConfiguration property #[zbus(property)] fn global_dns_configuration( &self, - ) -> zbus::Result>; + ) -> zbus::Result>; #[zbus(property)] fn set_global_dns_configuration( &self, - value: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + value: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// Metered property @@ -311,7 +305,7 @@ pub trait NetworkManager { /// PrimaryConnection property #[zbus(property)] - fn primary_connection(&self) -> zbus::Result; + fn primary_connection(&self) -> zbus::Result; /// PrimaryConnectionType property #[zbus(property)] diff --git a/src/network_manager/access_point.rs b/src/network_manager/access_point.rs index e6d7114..e732b72 100644 --- a/src/network_manager/access_point.rs +++ b/src/network_manager/access_point.rs @@ -16,11 +16,11 @@ use zbus::{Connection, Result, proxy}; impl AccessPointProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { AccessPointProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/active.rs b/src/network_manager/active.rs index 1b852aa..c788c88 100644 --- a/src/network_manager/active.rs +++ b/src/network_manager/active.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl ActiveProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { ActiveProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -38,11 +38,11 @@ pub trait Active { /// Connection property #[zbus(property)] - fn connection(&self) -> zbus::Result; + fn connection(&self) -> zbus::Result; /// Controller property #[zbus(property)] - fn controller(&self) -> zbus::Result; + fn controller(&self) -> zbus::Result; /// Default property #[zbus(property)] @@ -54,15 +54,15 @@ pub trait Active { /// Devices property #[zbus(property)] - fn devices(&self) -> zbus::Result>; + fn devices(&self) -> zbus::Result>; /// Dhcp4Config property #[zbus(property)] - fn dhcp4_config(&self) -> zbus::Result; + fn dhcp4_config(&self) -> zbus::Result; /// Dhcp6Config property #[zbus(property)] - fn dhcp6_config(&self) -> zbus::Result; + fn dhcp6_config(&self) -> zbus::Result; /// Id property #[zbus(property)] @@ -70,19 +70,19 @@ pub trait Active { /// Ip4Config property #[zbus(property)] - fn ip4_config(&self) -> zbus::Result; + fn ip4_config(&self) -> zbus::Result; /// Ip6Config property #[zbus(property)] - fn ip6_config(&self) -> zbus::Result; + fn ip6_config(&self) -> zbus::Result; /// Master property #[zbus(property)] - fn master(&self) -> zbus::Result; + fn master(&self) -> zbus::Result; /// SpecificObject property #[zbus(property)] - fn specific_object(&self) -> zbus::Result; + fn specific_object(&self) -> zbus::Result; /// State property #[zbus(property)] diff --git a/src/network_manager/adsl.rs b/src/network_manager/adsl.rs index dcbb32a..c0de260 100644 --- a/src/network_manager/adsl.rs +++ b/src/network_manager/adsl.rs @@ -16,11 +16,11 @@ use zbus::{Connection, Result, proxy}; impl AdslProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { AdslProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/agent_manager.rs b/src/network_manager/agent_manager.rs index d4c0344..d1d33e3 100644 --- a/src/network_manager/agent_manager.rs +++ b/src/network_manager/agent_manager.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl AgentManagerProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { AgentManagerProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/bluetooth.rs b/src/network_manager/bluetooth.rs index 56e3d36..87b6d81 100644 --- a/src/network_manager/bluetooth.rs +++ b/src/network_manager/bluetooth.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl BluetoothProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { BluetoothProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/bond.rs b/src/network_manager/bond.rs index 5c8cc0f..b3145fd 100644 --- a/src/network_manager/bond.rs +++ b/src/network_manager/bond.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl BondProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { BondProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -42,5 +42,5 @@ pub trait Bond { /// Slaves property #[zbus(property)] - fn slaves(&self) -> zbus::Result>; + fn slaves(&self) -> zbus::Result>; } diff --git a/src/network_manager/bridge.rs b/src/network_manager/bridge.rs index e89bf97..d890d09 100644 --- a/src/network_manager/bridge.rs +++ b/src/network_manager/bridge.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl BridgeProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { BridgeProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -42,5 +42,5 @@ pub trait Bridge { /// Slaves property #[zbus(property)] - fn slaves(&self) -> zbus::Result>; + fn slaves(&self) -> zbus::Result>; } diff --git a/src/network_manager/checkpoint.rs b/src/network_manager/checkpoint.rs index 95e90ae..f5a81eb 100644 --- a/src/network_manager/checkpoint.rs +++ b/src/network_manager/checkpoint.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl CheckpointProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { CheckpointProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -38,7 +38,7 @@ pub trait Checkpoint { /// Devices property #[zbus(property)] - fn devices(&self) -> zbus::Result>; + fn devices(&self) -> zbus::Result>; /// RollbackTimeout property #[zbus(property)] diff --git a/src/network_manager/connection.rs b/src/network_manager/connection.rs index fce0cd2..1027a30 100644 --- a/src/network_manager/connection.rs +++ b/src/network_manager/connection.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl ConnectionProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { ConnectionProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/device.rs b/src/network_manager/device.rs index 4a546c2..b56fc64 100644 --- a/src/network_manager/device.rs +++ b/src/network_manager/device.rs @@ -16,11 +16,11 @@ use zbus::{Connection, Result, proxy}; impl DeviceProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { DeviceProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -45,10 +45,7 @@ pub trait Device { &self, flags: u32, ) -> zbus::Result<( - std::collections::HashMap< - String, - std::collections::HashMap, - >, + std::collections::HashMap>, u64, )>; @@ -57,7 +54,7 @@ pub trait Device { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, version_id: u64, flags: u32, @@ -70,7 +67,7 @@ pub trait Device { /// ActiveConnection property #[zbus(property)] - fn active_connection(&self) -> zbus::Result; + fn active_connection(&self) -> zbus::Result; /// Autoconnect property #[zbus(property)] @@ -80,7 +77,7 @@ pub trait Device { /// AvailableConnections property #[zbus(property)] - fn available_connections(&self) -> zbus::Result>; + fn available_connections(&self) -> zbus::Result>; /// Capabilities property #[zbus(property)] @@ -92,11 +89,11 @@ pub trait Device { /// Dhcp4Config property #[zbus(property)] - fn dhcp4_config(&self) -> zbus::Result; + fn dhcp4_config(&self) -> zbus::Result; /// Dhcp6Config property #[zbus(property)] - fn dhcp6_config(&self) -> zbus::Result; + fn dhcp6_config(&self) -> zbus::Result; /// Driver property #[zbus(property)] @@ -132,7 +129,7 @@ pub trait Device { /// Ip4Config property #[zbus(property)] - fn ip4_config(&self) -> zbus::Result; + fn ip4_config(&self) -> zbus::Result; /// Ip4Connectivity property #[zbus(property)] @@ -140,7 +137,7 @@ pub trait Device { /// Ip6Config property #[zbus(property)] - fn ip6_config(&self) -> zbus::Result; + fn ip6_config(&self) -> zbus::Result; /// Ip6Connectivity property #[zbus(property)] @@ -154,7 +151,7 @@ pub trait Device { #[zbus(property)] fn lldp_neighbors( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Managed property #[zbus(property)] @@ -184,7 +181,7 @@ pub trait Device { /// Ports property #[zbus(property)] - fn ports(&self) -> zbus::Result>; + fn ports(&self) -> zbus::Result>; /// Real property #[zbus(property)] diff --git a/src/network_manager/dhcp4config.rs b/src/network_manager/dhcp4config.rs index 0f3d38e..c9c2068 100644 --- a/src/network_manager/dhcp4config.rs +++ b/src/network_manager/dhcp4config.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl DHCP4ConfigProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { DHCP4ConfigProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,7 +34,5 @@ impl DHCP4ConfigProxy<'_> { pub trait DHCP4Config { /// Options property #[zbus(property)] - fn options( - &self, - ) -> zbus::Result>; + fn options(&self) -> zbus::Result>; } diff --git a/src/network_manager/dhcp6config.rs b/src/network_manager/dhcp6config.rs index fdc1126..af0f8f1 100644 --- a/src/network_manager/dhcp6config.rs +++ b/src/network_manager/dhcp6config.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl DHCP6ConfigProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { DHCP6ConfigProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,7 +34,5 @@ impl DHCP6ConfigProxy<'_> { pub trait DHCP6Config { /// Options property #[zbus(property)] - fn options( - &self, - ) -> zbus::Result>; + fn options(&self) -> zbus::Result>; } diff --git a/src/network_manager/dns_manager.rs b/src/network_manager/dns_manager.rs index d0011f4..a97c980 100644 --- a/src/network_manager/dns_manager.rs +++ b/src/network_manager/dns_manager.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl DnsManagerProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { DnsManagerProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -36,7 +36,7 @@ pub trait DnsManager { #[zbus(property)] fn configuration( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Mode property #[zbus(property)] diff --git a/src/network_manager/dummy.rs b/src/network_manager/dummy.rs index b244a9f..8defa60 100644 --- a/src/network_manager/dummy.rs +++ b/src/network_manager/dummy.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl DummyProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { DummyProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/generic.rs b/src/network_manager/generic.rs index 76a5b58..715738b 100644 --- a/src/network_manager/generic.rs +++ b/src/network_manager/generic.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl GenericProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { GenericProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/hsr.rs b/src/network_manager/hsr.rs index d942e48..811b5d0 100644 --- a/src/network_manager/hsr.rs +++ b/src/network_manager/hsr.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl HsrProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { HsrProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -38,11 +38,11 @@ pub trait Hsr { /// Port1 property #[zbus(property)] - fn port1(&self) -> zbus::Result; + fn port1(&self) -> zbus::Result; /// Port2 property #[zbus(property)] - fn port2(&self) -> zbus::Result; + fn port2(&self) -> zbus::Result; /// Prp property #[zbus(property)] diff --git a/src/network_manager/infiniband.rs b/src/network_manager/infiniband.rs index 4bb97e3..d2666fa 100644 --- a/src/network_manager/infiniband.rs +++ b/src/network_manager/infiniband.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl InfinibandProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { InfinibandProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/ip4config.rs b/src/network_manager/ip4config.rs index 4c10b74..458299d 100644 --- a/src/network_manager/ip4config.rs +++ b/src/network_manager/ip4config.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl IP4ConfigProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { IP4ConfigProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -36,7 +36,7 @@ pub trait IP4Config { #[zbus(property)] fn address_data( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Addresses property #[zbus(property)] @@ -62,7 +62,7 @@ pub trait IP4Config { #[zbus(property)] fn nameserver_data( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Nameservers property #[zbus(property)] @@ -72,7 +72,7 @@ pub trait IP4Config { #[zbus(property)] fn route_data( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Routes property #[zbus(property)] diff --git a/src/network_manager/ip6config.rs b/src/network_manager/ip6config.rs index d6f736c..72c443f 100644 --- a/src/network_manager/ip6config.rs +++ b/src/network_manager/ip6config.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl IP6ConfigProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { IP6ConfigProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -36,7 +36,7 @@ pub trait IP6Config { #[zbus(property)] fn address_data( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Addresses property #[zbus(property)] @@ -67,7 +67,7 @@ pub trait IP6Config { #[zbus(property)] fn route_data( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Routes property #[zbus(property)] diff --git a/src/network_manager/iptunnel.rs b/src/network_manager/iptunnel.rs index 1458734..259dd12 100644 --- a/src/network_manager/iptunnel.rs +++ b/src/network_manager/iptunnel.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl IPTunnelProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { IPTunnelProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -66,7 +66,7 @@ pub trait IPTunnel { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; /// PathMtuDiscovery property #[zbus(property)] diff --git a/src/network_manager/loopback.rs b/src/network_manager/loopback.rs index 7e02cf0..b2ce46d 100644 --- a/src/network_manager/loopback.rs +++ b/src/network_manager/loopback.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl LoopbackProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { LoopbackProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/lowpan.rs b/src/network_manager/lowpan.rs index f7b1a2e..ab11210 100644 --- a/src/network_manager/lowpan.rs +++ b/src/network_manager/lowpan.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl LowpanProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { LowpanProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -38,5 +38,5 @@ pub trait Lowpan { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; } diff --git a/src/network_manager/macsec.rs b/src/network_manager/macsec.rs index 6232758..67bb32e 100644 --- a/src/network_manager/macsec.rs +++ b/src/network_manager/macsec.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl MacsecProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { MacsecProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -58,7 +58,7 @@ pub trait Macsec { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; /// Protect property #[zbus(property)] diff --git a/src/network_manager/macvlan.rs b/src/network_manager/macvlan.rs index 9037217..43525a3 100644 --- a/src/network_manager/macvlan.rs +++ b/src/network_manager/macvlan.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl MacvlanProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { MacvlanProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -42,7 +42,7 @@ pub trait Macvlan { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; /// Tap property #[zbus(property)] diff --git a/src/network_manager/modem.rs b/src/network_manager/modem.rs index 61e28c3..79c6d6b 100644 --- a/src/network_manager/modem.rs +++ b/src/network_manager/modem.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl ModemProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { ModemProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/nsp.rs b/src/network_manager/nsp.rs index b3d8ba4..03b4d5f 100644 --- a/src/network_manager/nsp.rs +++ b/src/network_manager/nsp.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl NspProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { NspProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/olpc_mesh.rs b/src/network_manager/olpc_mesh.rs index 294df6d..c8601ac 100644 --- a/src/network_manager/olpc_mesh.rs +++ b/src/network_manager/olpc_mesh.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl OlpcMeshProxy<'_> { pub async fn getnew_from_path_proxy( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { OlpcMeshProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -38,7 +38,7 @@ pub trait OlpcMesh { /// Companion property #[zbus(property)] - fn companion(&self) -> zbus::Result; + fn companion(&self) -> zbus::Result; /// HwAddress property #[zbus(property)] diff --git a/src/network_manager/ovs_bridge.rs b/src/network_manager/ovs_bridge.rs index 2d29e39..5bc7fb4 100644 --- a/src/network_manager/ovs_bridge.rs +++ b/src/network_manager/ovs_bridge.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl OvsBridgeProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { OvsBridgeProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,5 +34,5 @@ impl OvsBridgeProxy<'_> { pub trait OvsBridge { /// Slaves property #[zbus(property)] - fn slaves(&self) -> zbus::Result>; + fn slaves(&self) -> zbus::Result>; } diff --git a/src/network_manager/ovs_interface.rs b/src/network_manager/ovs_interface.rs index e5554cf..2f7f467 100644 --- a/src/network_manager/ovs_interface.rs +++ b/src/network_manager/ovs_interface.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl OvsInterfaceProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { OvsInterfaceProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/ovs_port.rs b/src/network_manager/ovs_port.rs index 9eb3317..dfb9d5b 100644 --- a/src/network_manager/ovs_port.rs +++ b/src/network_manager/ovs_port.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl OvsPortProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { OvsPortProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,5 +34,5 @@ impl OvsPortProxy<'_> { pub trait OvsPort { /// Slaves property #[zbus(property)] - fn slaves(&self) -> zbus::Result>; + fn slaves(&self) -> zbus::Result>; } diff --git a/src/network_manager/plugin.rs b/src/network_manager/plugin.rs index df3d8aa..7a0b8c8 100644 --- a/src/network_manager/plugin.rs +++ b/src/network_manager/plugin.rs @@ -16,9 +16,9 @@ TOOD: use zbus::{Connection, Result, proxy}; impl PluginProxy<'_> { - pub async fn new_from_path(device_path: zbus::zvariant::OwnedObjectPath, connection: &Connection) -> Result> { + pub async fn new_from_path(device_path: zbus::OwnedObjectPath, connection: &Connection) -> Result> { PluginProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -36,7 +36,7 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, ) -> zbus::Result<()>; @@ -45,9 +45,9 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - details: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + details: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// Disconnect method @@ -58,7 +58,7 @@ pub trait Plugin { &self, settings: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, ) -> zbus::Result; @@ -67,14 +67,14 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, ) -> zbus::Result<()>; /// SetConfig method fn set_config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// SetFailure method @@ -83,20 +83,20 @@ pub trait Plugin { /// SetIp4Config method fn set_ip4_config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// SetIp6Config method fn set_ip6_config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// Config signal #[zbus(signal)] fn config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// Failure signal @@ -107,14 +107,14 @@ pub trait Plugin { #[zbus(signal)] fn ip4_config( &self, - ip4config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + ip4config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// Ip6Config signal #[zbus(signal)] fn ip6_config( &self, - ip6config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + ip6config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// LoginBanner signal diff --git a/src/network_manager/ppp.rs b/src/network_manager/ppp.rs index d1d0aab..73fd9f5 100644 --- a/src/network_manager/ppp.rs +++ b/src/network_manager/ppp.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl PPPProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { PPPProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -41,13 +41,13 @@ pub trait PPP { /// SetIp4Config method fn set_ip4_config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// SetIp6Config method fn set_ip6_config( &self, - config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + config: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// SetState method diff --git a/src/network_manager/secret_agent.rs b/src/network_manager/secret_agent.rs index d52883b..5d82c8e 100644 --- a/src/network_manager/secret_agent.rs +++ b/src/network_manager/secret_agent.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl SecretAgentProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { SecretAgentProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -35,7 +35,7 @@ pub trait SecretAgent { /// CancelGetSecrets method fn cancel_get_secrets( &self, - connection_path: &zbus::zvariant::ObjectPath<'_>, + connection_path: &zbus::ObjectPath<'_>, setting_name: &str, ) -> zbus::Result<()>; @@ -44,9 +44,9 @@ pub trait SecretAgent { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - connection_path: &zbus::zvariant::ObjectPath<'_>, + connection_path: &zbus::ObjectPath<'_>, ) -> zbus::Result<()>; /// GetSecrets method @@ -54,17 +54,14 @@ pub trait SecretAgent { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - connection_path: &zbus::zvariant::ObjectPath<'_>, + connection_path: &zbus::ObjectPath<'_>, setting_name: &str, hints: &[&str], flags: u32, ) -> zbus::Result< - std::collections::HashMap< - String, - std::collections::HashMap, - >, + std::collections::HashMap>, >; /// SaveSecrets method @@ -72,8 +69,8 @@ pub trait SecretAgent { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - connection_path: &zbus::zvariant::ObjectPath<'_>, + connection_path: &zbus::ObjectPath<'_>, ) -> zbus::Result<()>; } diff --git a/src/network_manager/settings.rs b/src/network_manager/settings.rs index 1173257..bf21f73 100644 --- a/src/network_manager/settings.rs +++ b/src/network_manager/settings.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl SettingsProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { SettingsProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -37,22 +37,22 @@ pub trait Settings { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - ) -> zbus::Result; + ) -> zbus::Result; /// AddConnection2 method fn add_connection2( &self, settings: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, flags: u32, - args: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + args: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<( - zbus::zvariant::OwnedObjectPath, - std::collections::HashMap, + zbus::OwnedObjectPath, + std::collections::HashMap, )>; /// AddConnectionUnsaved method @@ -60,15 +60,15 @@ pub trait Settings { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, - ) -> zbus::Result; + ) -> zbus::Result; /// GetConnectionByUuid method - fn get_connection_by_uuid(&self, uuid: &str) -> zbus::Result; + fn get_connection_by_uuid(&self, uuid: &str) -> zbus::Result; /// ListConnections method - fn list_connections(&self) -> zbus::Result>; + fn list_connections(&self) -> zbus::Result>; /// LoadConnections method fn load_connections(&self, filenames: &[&str]) -> zbus::Result<(bool, Vec)>; @@ -81,11 +81,11 @@ pub trait Settings { /// ConnectionRemoved signal #[zbus(signal)] - fn connection_removed(&self, connection: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn connection_removed(&self, connection: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// NewConnection signal #[zbus(signal)] - fn new_connection(&self, connection: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn new_connection(&self, connection: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// CanModify property #[zbus(property)] @@ -93,7 +93,7 @@ pub trait Settings { /// Connections property #[zbus(property)] - fn connections(&self) -> zbus::Result>; + fn connections(&self) -> zbus::Result>; /// Hostname property #[zbus(property)] diff --git a/src/network_manager/settings_connection.rs b/src/network_manager/settings_connection.rs index 8a379ca..5fecc3e 100644 --- a/src/network_manager/settings_connection.rs +++ b/src/network_manager/settings_connection.rs @@ -16,11 +16,11 @@ use zbus::{Connection, Result, proxy}; impl SettingsConnectionProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { SettingsConnectionProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -44,20 +44,14 @@ pub trait SettingsConnection { &self, setting_name: &str, ) -> zbus::Result< - std::collections::HashMap< - String, - std::collections::HashMap, - >, + std::collections::HashMap>, >; /// GetSettings method fn get_settings( &self, ) -> zbus::Result< - std::collections::HashMap< - String, - std::collections::HashMap, - >, + std::collections::HashMap>, >; /// Save method @@ -68,7 +62,7 @@ pub trait SettingsConnection { &self, properties: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, ) -> zbus::Result<()>; @@ -77,18 +71,18 @@ pub trait SettingsConnection { &self, settings: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, flags: u32, - args: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, - ) -> zbus::Result>; + args: std::collections::HashMap<&str, zbus::Variant<'_>>, + ) -> zbus::Result>; /// UpdateUnsaved method fn update_unsaved( &self, properties: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + std::collections::HashMap<&str, zbus::Variant<'_>>, >, ) -> zbus::Result<()>; diff --git a/src/network_manager/statistics.rs b/src/network_manager/statistics.rs index 86abdaf..357ffa9 100644 --- a/src/network_manager/statistics.rs +++ b/src/network_manager/statistics.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl StatisticsProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { StatisticsProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/team.rs b/src/network_manager/team.rs index 9cd8651..ace19fe 100644 --- a/src/network_manager/team.rs +++ b/src/network_manager/team.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl TeamProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { TeamProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -46,5 +46,5 @@ pub trait Team { /// Slaves property #[zbus(property)] - fn slaves(&self) -> zbus::Result>; + fn slaves(&self) -> zbus::Result>; } diff --git a/src/network_manager/tun.rs b/src/network_manager/tun.rs index b3d1d71..9d6c993 100644 --- a/src/network_manager/tun.rs +++ b/src/network_manager/tun.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl TunProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { TunProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/veth.rs b/src/network_manager/veth.rs index 483206a..7d6d002 100644 --- a/src/network_manager/veth.rs +++ b/src/network_manager/veth.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl VethProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { VethProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,5 +34,5 @@ impl VethProxy<'_> { pub trait Veth { /// Peer property #[zbus(property)] - fn peer(&self) -> zbus::Result; + fn peer(&self) -> zbus::Result; } diff --git a/src/network_manager/vlan.rs b/src/network_manager/vlan.rs index 95550a8..43195da 100644 --- a/src/network_manager/vlan.rs +++ b/src/network_manager/vlan.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl VlanProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { VlanProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -42,7 +42,7 @@ pub trait Vlan { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; /// VlanId property #[zbus(property)] diff --git a/src/network_manager/vrf.rs b/src/network_manager/vrf.rs index e3ec7d2..f113869 100644 --- a/src/network_manager/vrf.rs +++ b/src/network_manager/vrf.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl VrfProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { VrfProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/vxlan.rs b/src/network_manager/vxlan.rs index e0c6ee2..229f934 100644 --- a/src/network_manager/vxlan.rs +++ b/src/network_manager/vxlan.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl VxlanProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { VxlanProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -74,7 +74,7 @@ pub trait Vxlan { /// Parent property #[zbus(property)] - fn parent(&self) -> zbus::Result; + fn parent(&self) -> zbus::Result; /// Proxy property #[zbus(property)] diff --git a/src/network_manager/wi_max.rs b/src/network_manager/wi_max.rs index 1d44210..f249e5b 100644 --- a/src/network_manager/wi_max.rs +++ b/src/network_manager/wi_max.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WiMaxProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WiMaxProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -33,19 +33,19 @@ impl WiMaxProxy<'_> { )] pub trait WiMax { /// GetNspList method - fn get_nsp_list(&self) -> zbus::Result>; + fn get_nsp_list(&self) -> zbus::Result>; /// NspAdded signal #[zbus(signal)] - fn nsp_added(&self, nsp: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn nsp_added(&self, nsp: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// NspRemoved signal #[zbus(signal)] - fn nsp_removed(&self, nsp: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn nsp_removed(&self, nsp: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// ActiveNsp property #[zbus(property)] - fn active_nsp(&self) -> zbus::Result; + fn active_nsp(&self) -> zbus::Result; /// Bsid property #[zbus(property)] @@ -65,7 +65,7 @@ pub trait WiMax { /// Nsps property #[zbus(property)] - fn nsps(&self) -> zbus::Result>; + fn nsps(&self) -> zbus::Result>; /// Rssi property #[zbus(property)] diff --git a/src/network_manager/wifi_p2p.rs b/src/network_manager/wifi_p2p.rs index 946b1db..970eaa5 100644 --- a/src/network_manager/wifi_p2p.rs +++ b/src/network_manager/wifi_p2p.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WifiP2PProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WifiP2PProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -35,7 +35,7 @@ pub trait WifiP2P { /// StartFind method fn start_find( &self, - options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + options: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// StopFind method @@ -43,11 +43,11 @@ pub trait WifiP2P { /// PeerAdded signal #[zbus(signal)] - fn peer_added(&self, peer: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn peer_added(&self, peer: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// PeerRemoved signal #[zbus(signal)] - fn peer_removed(&self, peer: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn peer_removed(&self, peer: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// HwAddress property #[zbus(property)] @@ -55,5 +55,5 @@ pub trait WifiP2P { /// Peers property #[zbus(property)] - fn peers(&self) -> zbus::Result>; + fn peers(&self) -> zbus::Result>; } diff --git a/src/network_manager/wifi_p2ppeer.rs b/src/network_manager/wifi_p2ppeer.rs index 6d63944..e819017 100644 --- a/src/network_manager/wifi_p2ppeer.rs +++ b/src/network_manager/wifi_p2ppeer.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WifiP2PPeerProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WifiP2PPeerProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/wire_guard.rs b/src/network_manager/wire_guard.rs index 206a922..1c5a1b9 100644 --- a/src/network_manager/wire_guard.rs +++ b/src/network_manager/wire_guard.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WireGuardProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WireGuardProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/wired.rs b/src/network_manager/wired.rs index bb2fe01..b05a585 100644 --- a/src/network_manager/wired.rs +++ b/src/network_manager/wired.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WiredProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WiredProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/src/network_manager/wireless.rs b/src/network_manager/wireless.rs index 907c13c..73f1541 100644 --- a/src/network_manager/wireless.rs +++ b/src/network_manager/wireless.rs @@ -16,11 +16,11 @@ use zbus::{Connection, Result, proxy}; impl WirelessProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WirelessProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } @@ -34,35 +34,32 @@ impl WirelessProxy<'_> { )] pub trait Wireless { /// GetAccessPoints method - fn get_access_points(&self) -> zbus::Result>; + fn get_access_points(&self) -> zbus::Result>; /// GetAllAccessPoints method - fn get_all_access_points(&self) -> zbus::Result>; + fn get_all_access_points(&self) -> zbus::Result>; /// RequestScan method fn request_scan( &self, - options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, + options: std::collections::HashMap<&str, zbus::Variant<'_>>, ) -> zbus::Result<()>; /// AccessPointAdded signal #[zbus(signal)] - fn access_point_added(&self, access_point: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>; + fn access_point_added(&self, access_point: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// AccessPointRemoved signal #[zbus(signal)] - fn access_point_removed( - &self, - access_point: zbus::zvariant::ObjectPath<'_>, - ) -> zbus::Result<()>; + fn access_point_removed(&self, access_point: zbus::ObjectPath<'_>) -> zbus::Result<()>; /// AccessPoints property #[zbus(property)] - fn access_points(&self) -> zbus::Result>; + fn access_points(&self) -> zbus::Result>; /// ActiveAccessPoint property #[zbus(property)] - fn active_access_point(&self) -> zbus::Result; + fn active_access_point(&self) -> zbus::Result; /// Bitrate property #[zbus(property)] diff --git a/src/network_manager/wpan.rs b/src/network_manager/wpan.rs index e1d63d0..458a703 100644 --- a/src/network_manager/wpan.rs +++ b/src/network_manager/wpan.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl WpanProxy<'_> { pub async fn new_from_path( - device_path: zbus::zvariant::OwnedObjectPath, + device_path: zbus::OwnedObjectPath, connection: &Connection, ) -> Result> { WpanProxy::builder(connection) - .path(device_path)? + .path(device_path) .build() .await } diff --git a/tests/zbus6.rs b/tests/zbus6.rs new file mode 100644 index 0000000..fa4c02c --- /dev/null +++ b/tests/zbus6.rs @@ -0,0 +1,104 @@ +#![cfg(all(unix, feature = "device", feature = "settings"))] + +use std::collections::HashMap; +use std::os::unix::net::UnixStream; +use std::time::Duration; + +use rusty_network_manager::{DeviceProxy, NetworkManagerProxy, SettingsConnectionProxy}; +use zbus::{Guid, OwnedObjectPath, OwnedVariant, Variant, connection::Builder}; + +type Settings = HashMap>; + +const DEVICE_PATH: &str = "/org/freedesktop/NetworkManager/Devices/1"; +const SETTINGS_PATH: &str = "/org/freedesktop/NetworkManager/Settings/1"; + +struct NetworkManager; + +#[zbus::interface(name = "org.freedesktop.NetworkManager")] +impl NetworkManager { + fn get_device_by_ip_iface(&self, iface: &str) -> zbus::fdo::Result { + if iface != "wlan0" { + return Err(zbus::fdo::Error::InvalidArgs(iface.to_owned())); + } + Ok(OwnedObjectPath::try_from(DEVICE_PATH).unwrap()) + } +} + +struct Device; + +#[zbus::interface(name = "org.freedesktop.NetworkManager.Device")] +impl Device { + #[zbus(property)] + fn state(&self) -> u32 { + 100 + } +} + +#[derive(Default)] +struct SettingsConnection { + settings: Settings, +} + +#[zbus::interface(name = "org.freedesktop.NetworkManager.Settings.Connection")] +impl SettingsConnection { + fn update(&mut self, properties: Settings) { + self.settings = properties; + } + + fn get_settings(&self) -> Settings { + self.settings.clone() + } +} + +// Exercise real proxy calls without a system bus, NetworkManager, or network changes. +#[tokio::test] +async fn proxies_use_zbus6_paths_properties_and_variants() { + tokio::time::timeout(Duration::from_secs(10), async { + let (server_socket, client_socket) = UnixStream::pair().unwrap(); + let server = Builder::unix_stream(server_socket) + .server(Guid::generate()) + .p2p() + .serve_at("/org/freedesktop/NetworkManager", NetworkManager) + .serve_at(DEVICE_PATH, Device) + .serve_at(SETTINGS_PATH, SettingsConnection::default()) + .build(); + let client = Builder::unix_stream(client_socket).p2p().build(); + let (_server, client) = tokio::try_join!(server, client).unwrap(); + + let nm = NetworkManagerProxy::new(&client).await.unwrap(); + let device_path = nm.get_device_by_ip_iface("wlan0").await.unwrap(); + assert_eq!(device_path.as_str(), DEVICE_PATH); + let device = DeviceProxy::new_from_path(device_path, &client) + .await + .unwrap(); + assert_eq!(device.state().await.unwrap(), 100); + + let settings = SettingsConnectionProxy::new_from_path( + OwnedObjectPath::try_from(SETTINGS_PATH).unwrap(), + &client, + ) + .await + .unwrap(); + settings + .update(HashMap::from([( + "connection", + HashMap::from([ + ("id", Variant::from("test-wifi")), + ("autoconnect", Variant::from(true)), + ("autoconnect-retries", Variant::from(3_i32)), + ]), + )])) + .await + .unwrap(); + let result = settings.get_settings().await.unwrap(); + let connection = &result["connection"]; + assert_eq!(<&str>::try_from(&connection["id"]).unwrap(), "test-wifi"); + assert!(bool::try_from(&connection["autoconnect"]).unwrap()); + assert_eq!( + i32::try_from(&connection["autoconnect-retries"]).unwrap(), + 3 + ); + }) + .await + .expect("D-Bus proxy round trip timed out"); +} From 1413a9c5b459841568da398cc0580233b26054ce Mon Sep 17 00:00:00 2001 From: Cristian Filipescu Date: Sun, 25 Oct 2026 23:27:24 -0400 Subject: [PATCH 2/2] Limit zbus 6 migration to required compatibility changes --- .github/workflows/ci.yml | 8 +-- Cargo.lock | 1 - Cargo.toml | 3 +- README.md | 18 +---- examples/wifi_active_ap.rs | 2 +- src/network_manager/dns_manager.rs | 6 +- src/network_manager/plugin.rs | 26 ++++---- tests/zbus6.rs | 104 ----------------------------- 8 files changed, 22 insertions(+), 146 deletions(-) delete mode 100644 tests/zbus6.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b67f8..b803645 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,22 +35,20 @@ jobs: toolchain: ${{ matrix.rust }} - uses: swatinem/rust-cache@v2 - name: cargo-check - run: | - cargo check --all-targets --all-features --locked - cargo check --no-default-features --lib --locked + run: cargo check --locked fmt: name: format runs-on: ubuntu-latest env: - RUSTUP_TOOLCHAIN: 1.89.0 + RUSTUP_TOOLCHAIN: 1.87.0 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.89.0 + toolchain: 1.87.0 components: rustfmt - name: cargo-fmt run: cargo fmt -- --check diff --git a/Cargo.lock b/Cargo.lock index 87e67b1..b3f845f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -704,7 +704,6 @@ version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ - "getrandom", "js-sys", "serde", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index fca48fe..f9b7fdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ name = "rusty_network_manager" description = "A crate for interacting with network_manager using zbus" version = "0.7.1" edition = "2024" -rust-version = "1.89" license = "MIT" homepage = "https://github.com/KevinVoell/network_manager" repository = "https://github.com/KevinVoell/network_manager" @@ -24,7 +23,7 @@ bindgen = "0.72.1" [dev-dependencies] tokio = { version = "1.47.1", features = ["full"] } tokio-stream = "0.1.17" -zbus = { version = "6.1.0", features = ["p2p"] } +zbus = "6.1.0" [features] default = ["full"] diff --git a/README.md b/README.md index 63de028..2473a48 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ through NetworkManager. ## Prerequisites Before you can use this project, ensure you have the following installed: -- Rust 1.89 or newer and Cargo +- Rust and Cargo (latest stable version recommended) - NetworkManager on your Linux distribution ## Installation @@ -43,22 +43,6 @@ To use this project, follow these steps: This section provides basic examples of how to use the project to interact with NetworkManager through zbus. -### Migrating to zbus 6 - -This crate uses zbus 6. Applications that pass a `zbus::Connection` or other -zbus types to these proxies must also use zbus 6. - -- Use `zbus::ObjectPath` and `zbus::OwnedObjectPath` for object paths. -- Replace `zbus::zvariant::Value` and `OwnedValue` with `zbus::Variant` and - `zbus::OwnedVariant` for connection settings and other variant values. -- Proxy builder setters such as `.path(...)` now return the builder directly; - errors are reported by `.build().await`. -- Generated blocking proxies are no longer available. Use the async proxies, - or drive an async operation with `zbus::block_on`. - -See the [zbus 6 migration guide](https://z-galaxy.github.io/zbus/upgrading-to-6.html) -for the full list of upstream changes. - ## Contributing We welcome contributions! Please open an issue or submit a pull request for any diff --git a/examples/wifi_active_ap.rs b/examples/wifi_active_ap.rs index c6fe687..3b86fbf 100644 --- a/examples/wifi_active_ap.rs +++ b/examples/wifi_active_ap.rs @@ -30,7 +30,7 @@ async fn main() { .await .expect("Could not get NetworkManager"); - //let settings_path = zbus::OwnedObjectPath::try_from("org.freedesktop.NetworkManager.Settings".to_string()); + //let settings_path = zbus::zvariant::OwnedObjectPath::try_from("org.freedesktop.NetworkManager.Settings".to_string()); //let settings_proxy = SettingsProxy::new_from_path(settings_path.unwrap(), &connection); let args: Vec = env::args().collect(); diff --git a/src/network_manager/dns_manager.rs b/src/network_manager/dns_manager.rs index a97c980..d0011f4 100644 --- a/src/network_manager/dns_manager.rs +++ b/src/network_manager/dns_manager.rs @@ -15,11 +15,11 @@ use zbus::{Connection, Result, proxy}; impl DnsManagerProxy<'_> { pub async fn new_from_path( - device_path: zbus::OwnedObjectPath, + device_path: zbus::zvariant::OwnedObjectPath, connection: &Connection, ) -> Result> { DnsManagerProxy::builder(connection) - .path(device_path) + .path(device_path)? .build() .await } @@ -36,7 +36,7 @@ pub trait DnsManager { #[zbus(property)] fn configuration( &self, - ) -> zbus::Result>>; + ) -> zbus::Result>>; /// Mode property #[zbus(property)] diff --git a/src/network_manager/plugin.rs b/src/network_manager/plugin.rs index 7a0b8c8..df3d8aa 100644 --- a/src/network_manager/plugin.rs +++ b/src/network_manager/plugin.rs @@ -16,9 +16,9 @@ TOOD: use zbus::{Connection, Result, proxy}; impl PluginProxy<'_> { - pub async fn new_from_path(device_path: zbus::OwnedObjectPath, connection: &Connection) -> Result> { + pub async fn new_from_path(device_path: zbus::zvariant::OwnedObjectPath, connection: &Connection) -> Result> { PluginProxy::builder(connection) - .path(device_path) + .path(device_path)? .build() .await } @@ -36,7 +36,7 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::Variant<'_>>, + std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, >, ) -> zbus::Result<()>; @@ -45,9 +45,9 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::Variant<'_>>, + std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, >, - details: std::collections::HashMap<&str, zbus::Variant<'_>>, + details: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// Disconnect method @@ -58,7 +58,7 @@ pub trait Plugin { &self, settings: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::Variant<'_>>, + std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, >, ) -> zbus::Result; @@ -67,14 +67,14 @@ pub trait Plugin { &self, connection: std::collections::HashMap< &str, - std::collections::HashMap<&str, zbus::Variant<'_>>, + std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, >, ) -> zbus::Result<()>; /// SetConfig method fn set_config( &self, - config: std::collections::HashMap<&str, zbus::Variant<'_>>, + config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// SetFailure method @@ -83,20 +83,20 @@ pub trait Plugin { /// SetIp4Config method fn set_ip4_config( &self, - config: std::collections::HashMap<&str, zbus::Variant<'_>>, + config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// SetIp6Config method fn set_ip6_config( &self, - config: std::collections::HashMap<&str, zbus::Variant<'_>>, + config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// Config signal #[zbus(signal)] fn config( &self, - config: std::collections::HashMap<&str, zbus::Variant<'_>>, + config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// Failure signal @@ -107,14 +107,14 @@ pub trait Plugin { #[zbus(signal)] fn ip4_config( &self, - ip4config: std::collections::HashMap<&str, zbus::Variant<'_>>, + ip4config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// Ip6Config signal #[zbus(signal)] fn ip6_config( &self, - ip6config: std::collections::HashMap<&str, zbus::Variant<'_>>, + ip6config: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>, ) -> zbus::Result<()>; /// LoginBanner signal diff --git a/tests/zbus6.rs b/tests/zbus6.rs deleted file mode 100644 index fa4c02c..0000000 --- a/tests/zbus6.rs +++ /dev/null @@ -1,104 +0,0 @@ -#![cfg(all(unix, feature = "device", feature = "settings"))] - -use std::collections::HashMap; -use std::os::unix::net::UnixStream; -use std::time::Duration; - -use rusty_network_manager::{DeviceProxy, NetworkManagerProxy, SettingsConnectionProxy}; -use zbus::{Guid, OwnedObjectPath, OwnedVariant, Variant, connection::Builder}; - -type Settings = HashMap>; - -const DEVICE_PATH: &str = "/org/freedesktop/NetworkManager/Devices/1"; -const SETTINGS_PATH: &str = "/org/freedesktop/NetworkManager/Settings/1"; - -struct NetworkManager; - -#[zbus::interface(name = "org.freedesktop.NetworkManager")] -impl NetworkManager { - fn get_device_by_ip_iface(&self, iface: &str) -> zbus::fdo::Result { - if iface != "wlan0" { - return Err(zbus::fdo::Error::InvalidArgs(iface.to_owned())); - } - Ok(OwnedObjectPath::try_from(DEVICE_PATH).unwrap()) - } -} - -struct Device; - -#[zbus::interface(name = "org.freedesktop.NetworkManager.Device")] -impl Device { - #[zbus(property)] - fn state(&self) -> u32 { - 100 - } -} - -#[derive(Default)] -struct SettingsConnection { - settings: Settings, -} - -#[zbus::interface(name = "org.freedesktop.NetworkManager.Settings.Connection")] -impl SettingsConnection { - fn update(&mut self, properties: Settings) { - self.settings = properties; - } - - fn get_settings(&self) -> Settings { - self.settings.clone() - } -} - -// Exercise real proxy calls without a system bus, NetworkManager, or network changes. -#[tokio::test] -async fn proxies_use_zbus6_paths_properties_and_variants() { - tokio::time::timeout(Duration::from_secs(10), async { - let (server_socket, client_socket) = UnixStream::pair().unwrap(); - let server = Builder::unix_stream(server_socket) - .server(Guid::generate()) - .p2p() - .serve_at("/org/freedesktop/NetworkManager", NetworkManager) - .serve_at(DEVICE_PATH, Device) - .serve_at(SETTINGS_PATH, SettingsConnection::default()) - .build(); - let client = Builder::unix_stream(client_socket).p2p().build(); - let (_server, client) = tokio::try_join!(server, client).unwrap(); - - let nm = NetworkManagerProxy::new(&client).await.unwrap(); - let device_path = nm.get_device_by_ip_iface("wlan0").await.unwrap(); - assert_eq!(device_path.as_str(), DEVICE_PATH); - let device = DeviceProxy::new_from_path(device_path, &client) - .await - .unwrap(); - assert_eq!(device.state().await.unwrap(), 100); - - let settings = SettingsConnectionProxy::new_from_path( - OwnedObjectPath::try_from(SETTINGS_PATH).unwrap(), - &client, - ) - .await - .unwrap(); - settings - .update(HashMap::from([( - "connection", - HashMap::from([ - ("id", Variant::from("test-wifi")), - ("autoconnect", Variant::from(true)), - ("autoconnect-retries", Variant::from(3_i32)), - ]), - )])) - .await - .unwrap(); - let result = settings.get_settings().await.unwrap(); - let connection = &result["connection"]; - assert_eq!(<&str>::try_from(&connection["id"]).unwrap(), "test-wifi"); - assert!(bool::try_from(&connection["autoconnect"]).unwrap()); - assert_eq!( - i32::try_from(&connection["autoconnect-retries"]).unwrap(), - 3 - ); - }) - .await - .expect("D-Bus proxy round trip timed out"); -}