Skip to content

0.21.0

Compare
Choose a tag to compare
@tmds tmds released this 20 Nov 12:36
· 3 commits to main since this release
b3b8de2

Tmds.DBus.Protocol

In v0.17.0 support for NativeAOT safe variant handling was enabled through two types: VariantValue for reading variants,
and Variant for writing variants. The focus on this release is to support both reading and writing using the VariantValue type.
This enables writing back variants that were previously read.

The Variant type has been marked obsolete. Users should now be able to use the VariantValue type as a direct replacement.
Note that the Dict/Array/Struct types are not obsolete. They can be used for creating composite VariantValues.

The VariantValue type now behaves different for variants that hold other variants. Such variants are not common because
usually a variant will directly hold an actual (that is: non-variant) value. Variants that hold other variants are represented
as their own VariantValue instance with a Type of Variant. The nested variant value can be obtained by calling GetVariantValue.

There are some additional breaking API changes which shouldn't affect most users because involve low-level APIs for D-Bus marshalling and signature handling.

  • The Utf8Span type has been removed. APIs use ReadOnlySpan<byte> instead.
  • VariantValue.GetSignature returns a Signature (instead of a string).
  • VariantValue.GetArray<T> requires a T of Signature (instead of a string) for getting arrays of signature.
  • Reader.ReadSignature returns Signature instead of Utf8Span. ReadSignatureAsSignature has been removed. The new ReadSignatureAsSpan returns ReadOnlySpan<byte>.

Tmds.DBus.Tool

The following fixes have been made to the codegen command for the protocol API (in #307):

  • Generate writable properties for Set-methods only.
  • PropertyChanges: invalidated and changed are swapped.