2024-06-29 16:53:27 +02:00
|
|
|
Version NEXT:
|
2025-11-01 15:36:04 +01:00
|
|
|
* Changes
|
|
|
|
|
- Fix some Clippy warnings
|
2025-09-17 20:03:18 +02:00
|
|
|
|
2025-10-24 13:00:39 +02:00
|
|
|
Version 0.3.0, release 2025-10-28:
|
|
|
|
|
* Changes
|
|
|
|
|
- Bump minidom dep to 0.18, which has breaking changes.
|
|
|
|
|
|
2025-09-17 20:03:18 +02:00
|
|
|
Version 0.2.0, released 2025-09-17:
|
2024-06-29 16:53:27 +02:00
|
|
|
0000-00-00 Jonas Schäfer <jonas@zombofant.net>
|
2024-08-03 10:51:23 +02:00
|
|
|
* Breaking
|
|
|
|
|
- The methods of `TextCodec<T>` now have `&self` receivers. This also
|
|
|
|
|
implies that `#[xml(text(codec = ..))]` now takes expressions instead
|
|
|
|
|
of type paths.
|
|
|
|
|
|
|
|
|
|
Because all implementations provided by `xso` were in fact unit
|
2024-08-03 11:19:09 +02:00
|
|
|
structs, this should not change most invocations, with one exception:
|
|
|
|
|
The type argument of `Base64` was removed. Replace all `Base64<Foo>`
|
|
|
|
|
references with `Base64.filtered(Foo)` to update your code.
|
2024-08-03 10:51:23 +02:00
|
|
|
|
|
|
|
|
This change overall allows for more flexibility in the implementation
|
|
|
|
|
of text codecs.
|
2025-04-18 19:42:42 +02:00
|
|
|
- `xml:lang` attributes are now silently discarded during
|
|
|
|
|
deserialisation unless captured by `#[xml(attribute = "xml:lang")]` or
|
|
|
|
|
equivalent. This is because `xml:lang` is special as per
|
|
|
|
|
XML 1.0 § 2.12 and it is generally preferable to allow it to occur
|
|
|
|
|
anywhere in the document.
|
2025-04-18 17:20:06 +02:00
|
|
|
- The `FromXml::from_events` and `FromEventsBuilder::feed` functions
|
|
|
|
|
gained an additional argument to support `xml:lang` inheritance.
|
2024-06-29 15:22:52 +02:00
|
|
|
* Added
|
2024-06-30 09:27:48 +02:00
|
|
|
- Support for child elements in derive macros. Child elements may also
|
2024-07-11 17:29:29 +02:00
|
|
|
be wrapped in Option or Box or in containers like Vec or HashSet.
|
2024-07-27 08:52:08 +02:00
|
|
|
- Support for overriding the names of the types generated by the derive
|
|
|
|
|
macros.
|
2024-06-30 09:06:10 +02:00
|
|
|
- Support for deriving FromXml and AsXml on enums.
|
2024-08-01 17:16:55 +02:00
|
|
|
- Support for extracting data from child elements without intermediate
|
|
|
|
|
structs.
|
2024-08-05 08:20:25 +02:00
|
|
|
- Support for collecting all unknown children in a single field as
|
2024-12-19 20:36:57 +01:00
|
|
|
collection of `minidom::Element`, or one unknown child as a
|
2024-12-20 18:41:39 +01:00
|
|
|
`minidom::Element`, or zero or one unknown children as an
|
|
|
|
|
`Option<minidom::Element>`.
|
2024-08-05 15:32:54 +02:00
|
|
|
- Support for "transparent" structs (newtype-like patterns for XSO).
|
2024-12-17 17:00:53 +01:00
|
|
|
- FromXmlText and AsXmlText are now implemented for jid::NodePart,
|
|
|
|
|
jid::DomainPart, and jid::ResourcePart (!485)
|
2025-01-20 17:51:22 +01:00
|
|
|
- Support for optional child elements, the presence of which are
|
|
|
|
|
translated into a boolean (`#[xml(flag)]`).
|
2025-01-25 12:22:05 +01:00
|
|
|
- Generic TextCodec implementation for all base64 engines provided by
|
|
|
|
|
the base64 crate (if the `base64` feature is enabled).
|
2025-01-25 16:21:22 +01:00
|
|
|
- New `codec` field on `attribute` meta, to support decoding and
|
|
|
|
|
encoding using any `TextCodec`.
|
2025-01-26 11:18:03 +01:00
|
|
|
- Support for `no_std` usage (the alloc crate is required, though).
|
2025-02-12 19:33:53 +01:00
|
|
|
- Add a PrintRawXml helper struct to be able to display raw xml, useful
|
|
|
|
|
for debug logs.
|
2025-04-05 13:06:18 +02:00
|
|
|
- Support to selectively discard attributes or text content during
|
|
|
|
|
parsing (!552).
|
2025-04-07 20:15:44 +02:00
|
|
|
- Implement `AsXml` and `FromXml` for serde_json::Value` behind
|
|
|
|
|
`serde_json` feature.
|
2025-04-05 13:38:05 +02:00
|
|
|
- Support for a post-deserialization callback function call. (!553)
|
2025-04-18 17:20:06 +02:00
|
|
|
- Support for correctly inheriting `xml:lang` values throughout the
|
|
|
|
|
XML document.
|
2025-05-02 16:54:42 +02:00
|
|
|
- `xso::convert_via_fromstr_and_display`, a declarative macro to provide
|
|
|
|
|
`AsXmlText` and `FromXmlText` implementations based on the standard
|
|
|
|
|
library's `Display` and `FromStr` traits.
|
2025-05-01 10:30:46 +02:00
|
|
|
- `AsXmlDyn`, a dyn-compatible variant of `AsXml` (!573).
|
2025-05-01 13:30:44 +02:00
|
|
|
- `FromXml::xml_name_matcher()` and related types, which allow `FromXml`
|
|
|
|
|
implementors to provide cachable hints to callers about which XML
|
|
|
|
|
elements are valid candidates for parsing (!573).
|
2025-05-02 13:15:16 +02:00
|
|
|
- `Xso<dyn Trait>`, a Box-like struct which can hold a dynamically-typed
|
|
|
|
|
XSO, alongside related traits and (declarative) macros (!573).
|
2025-05-02 13:51:31 +02:00
|
|
|
- `XsoVec<dyn Trait>`, a container which can hold dynamically-typed
|
|
|
|
|
XSOs (!573).
|
2025-01-28 18:24:37 +01:00
|
|
|
* Changes
|
|
|
|
|
- Generated AsXml iterator and FromXml builder types are now
|
|
|
|
|
doc(hidden), to not clutter hand-written documentation with auto
|
|
|
|
|
generated garbage (something certain big tech companies could take
|
|
|
|
|
an example of, honestly).
|
2025-04-18 10:46:09 +02:00
|
|
|
- Fixed bug where putting an attribute field below any non-attribute
|
|
|
|
|
field in a struct definition would cause a compile-time error when
|
|
|
|
|
deriving `AsXml`.
|
2025-04-18 17:19:56 +02:00
|
|
|
- Update rxml dependency to 0.13.
|
xso: reject attempts to match the same XML attribute in different fields
This was a bit tricky to build, because it is possible to have an
indirection through a `static` there. Thanks to Rust's extensive
const-fn capabilities, though, it's in fact possible to cover all cases.
We still do two different checks to improve user experience. If we can,
from within the proc macro, determine that two fields refer to the same
XML attribute (because their namespace/name values use the same Rust
tokens), then we reject the fields with a clear error message pointing
at both fields.
In the other case, when there's e.g. `#[xml(lang)]` and
`#[xml(attribute(namespace = rxml::XMLNS_XML, name = "lang"))]`, the
macro cannot be sure that XMLNS_XML is in fact the XML namespace. For
that case, we generate code which is evaluated at compile time (and
has no runtime impact) which panics if the namespace and name of two
attribute-matching fields is the same.
The error message will be less clear (because it contains extra,
unchangeable wording like "evaluation of constant value failed" and "the
evaluated program panicked at", which may be a bit confusing) than the
message generated by the macros themselves, but it's a price we have to
pay unfortunately.
Note that this check may seem cosmetic and purely for better user
experience, but it is in fact needed to avoid generating not-well-formed
and/or not-namespace-well-formed XML: As `AsXml` generates `xso::Item`,
where each attribute is emitted separated (and not aggregated in a
map structure), a naive (and efficient) implementation of a writer might
not double-check that no duplicate attributes are generated.
2025-04-27 09:26:56 +02:00
|
|
|
- xso now rejects conflicting `#[xml(attribute)]` (and `#[xml(lang)]`)
|
|
|
|
|
specifications at compile time.
|
2025-04-27 12:21:42 +02:00
|
|
|
- Deprecate `try_from_element` in favour of `transform`.
|
2024-06-29 16:53:27 +02:00
|
|
|
|
2024-07-26 18:24:02 +02:00
|
|
|
Version 0.1.2:
|
|
|
|
|
2024-07-26 Jonas Schäfer <jonas@zombofant.net>
|
|
|
|
|
* Added
|
|
|
|
|
- FromXmlText and AsXmlText are now implemented on char.
|
|
|
|
|
* Fixed
|
|
|
|
|
- Docs build on docs.rs now shows feature-gated items.
|
|
|
|
|
|
2024-07-25 18:53:31 +02:00
|
|
|
Version 0.1.1:
|
|
|
|
|
2024-07-25 Maxime “pep” Buquet <pep@bouah.net>
|
|
|
|
|
* Added
|
|
|
|
|
- Import various text codecs from parsers: FixedHex, ColonSeparatedHex,
|
|
|
|
|
EmptyAsError.
|
|
|
|
|
|
2024-07-25 09:52:44 +02:00
|
|
|
Version 0.1.0:
|
|
|
|
|
2024-07-25 Jonas Schäfer <jonas@zombofant.net>
|
2024-07-24 16:27:33 +02:00
|
|
|
* Initial release of this crate
|