π zbus 4.0.0
github-actions
released this
12 Feb 19:33
·
1135 commits
to main
since this release
A new API-breaking release that brings in a huge amount of changes. Most using code should still
compile (with deprecation warnings) and work without changes. Hightlights:
- π Changing names of dbus_interface and dbus_proxy along with their atrributes. See
zbus_macros release notes for details, including commands to automatically update your
code. - π½οΈ Adapt to zvariant 4.0 changes.
- π Make use of submodules for nicer API hierarchy. In most cases
deprecation warnings will guide you to the new paths. - π XML parsing API split into a separate crate, zbus_xml. The
xml
andquick-xml
feature flags are removed as a result. #413. - ποΈ Message API overhaul
- πΈ header method and message::Header getters now infallible.
- π·οΈ body method now returns a new type, message::Body that provides all message body-related API.
- π₯ MessageField* API dropped. Use Message::header() with message::Header's specific getters.
- π₯ message::Type::Invalid variant dropped. We just don't let a message be created for invalid types.
- π as_bytes method renamed to data and now returns
&zvariant::serialized::Data
. - π₯ Drop Message::take_fds() method. This was never a good idea because it is basically
unsafe (even though it's not marked as such) since it disassociates the FDs from the message and
the caller is free to close them while message is still referencing them. - π·οΈ All serial number related API now use NonZeroU32.
- πΈ constructors now return a Builder instance.
- πΈ Arc wrapping of message no longer needed and all API using Arc type now use Message.
- π₯ Drop unneeded From for message::Type.
- π Connection
- π₯ Drop futures::Sink implementation. This was proving very difficult to maintain and most
likely used by very few people, who can use thesend
method instead. - π·οΈ server_guid return
&Guid
now, instead of a string. - π₯ connection::Builder::server now takes anything TryInto and hence fallible.
- π₯
connection::Builder ensures GUID is correct for client: If the client connection is
constructed through an address with GUID in it, we should verify this GUID is the same as one
received from the server during the handshake. - ποΈ Socket trait now higher-level, async and split into read and write
halves. - π₯ Remove unnecessary constraints on Socket. and associated types.
- β¨ Add missing blocking::connection::Builder::socket.
- β¨ Proper support for abstract unix sockets that makes use of the std API. This replaces our hack.
- π₯ Drop futures::Sink implementation. This was proving very difficult to maintain and most
- π₯ Split Guid into reference & owned types.
Guid
now has a lifetime parameter, and
OwnedGuid
is a new type that's a wrapper aroundGuid<'static>
. Internally,Guid
is now a
wrapper aroundzvariant::Str
and is now a very similar type to otherzvariant::Str
wrapper
types. - ποΈ Address API overhaul:
- π₯ Split transport bits into a separate type hierarchy,
address::Transport.
Address` is
no longer an enum but a struct with hidden fields. #476. - β¨ Support GUIDs. We previously just ignored GUIDs in addresses. No more. We now parse it, if
present and provide API to set a GUID on anAddress
instance. - β¨ Support
unix:tmpdir
andunix:dir
transports. - π Fix Display impl for address of abstract Unix sockets.
- π₯ Split transport bits into a separate type hierarchy,
- β¨ Relax type bound on Proxy::call/call_with_flags. A bound of
for<'d> zvariant::DynamicDeserialize<'d>
on the result type of a call is sufficient to
deserialize; use this bound instead of the stricterDeserializeOwned + zvariant::Type
. - ποΈ Some APIs deprecated (the deprecation warnings will give a hint).
- π₯ Drop Error::NoBodySignature variant
- π₯ Drop Deprecated APIs.
- π© Gate all p2p API behind a
p2p
feature. Given that typical users do not need this API, we don't enable it by default. - π© Add
bus-impl
cargo feature. API that is only needed by bus implementations now gated behind this non-default cargo feature. #480.
the peer-to-peer and bus implementation API respectively. - β¬οΈ Migrate from winapi to windows-sys (#534).
- β¬οΈ Dependencies bumped
- event-listener 5.0.
- async-broadcast 0.7.0.
- async-process 2.0.
- async-io 2.0.
- async-lock 3.0.
- async-fs 2.0.
- vsock 0.4.
- tokio-vsock 0.4.
- nix 0.27.
- β Dependencies dropped
- once_cell
- byteorder. Use endi crate instead through zvariant.
async-recursion
for targets other than MacOS and Windows.
- β¬οΈ Bump MSRV to 1.75
- π§ Switch to Rust 2021. This doesn't affect our users but gives us some features.
- π©Ή implement peer_credentials() for tokio win32.
- π Pin tokio to only its major version. This allows it to be upgraded to any API-compatible versions.
- ποΈ Don't send ObjectManager signals before Hello method.
- ποΈ Fix a pointer access on Windows. Details at: microsoft/windows-rs#2842
- ποΈ Fix use-after-free in Windows SID code.
- π₯ Don't assume defaults in fdo interfaces. Otherwise people will forget to set them and then wonder why their code is not working.
- π₯ Drop Deref impl for
blocking::ObjectServer
. Not exactly a smart pointer. Also other blocking wrappers don't do that. #475. - β¨ Support non-native endian:
- Respond to messages using the same endian. This makes sense and it's also what gdbus does.
- Add message::Builder::endian. This allows one to specify the endianness of the message they're constructing.
- π book: Add a simpler D-Bus signals example.
- π Use the correct traversal order for node tree introspection in ObjectServer.
- π₯ Serial numbers now globally assigned to messages, instead of
Connection
managing the serial numbers. - π© Add
option-as-array
feature. This is a mainly azvariant
proxy/forwarding feature. - π© Remove unused gvariant feature. zbus doesn't actually make use of this even if it was
enabled. This only causes confusion if user enables it since thenOption<T>
haszvariant::Type
implemented but D-Bus encoding doesn't support that and people get runtime errors instead. - π©Ή Server connection should reject fd-passing if not possible. If the client asks for
fd-passing on socket type that doesn't support it, reject the request. - π₯ Make interface arg on fdo::PropertiesProxy::get_all optional. This is as per the specs. #302.
- ποΈ Deprecate proxy::Builder::new_bare method. In favor of proxy::Builder::new(), which
new_bare is just a wrapper around now, since all proxy types implement ProxyDefault trait. #417. - β¨ impl ProxyDefault for Proxy.
- ποΈ ProxyDefault's constants now optional. This makes things a bit simpler and streamlined by
allowing all generated proxies to implement this trait. - β¨ Add ProxyImpl trait that macro-generated proxies implement. It makes it possible to write
generic code around different proxy types. #433 - π©Ή fdo proxies now don't assume default service and paths.
- β‘οΈ Some optimizations.
- π add some logging to handshake code.
- π hide ResultAdapter from the doc, it's internal helper API.
- π¨ Fix formatting of Cargo.toml file.