Requires a complete change of the HTML tree, to have interior mutability
and be able to return borrowed data from a Handle.
It is now a Rc-based tree where each node has a weak reference to
its parent and strong references to its children.
This results ina few breaking changes to the public API.
Allow MSC3401-style call membership state events to have state keys that
are arbitrary strings, and not just pure MXIDs.
This allows for state keys that are suffixed with the sender's device
ID, as well as ones prefixed by an underscore to bypass auth rules over
state keys that start with a `@` but do not strictly equal an MXID.
It seems that we cant count on serde_json::to_value to detect
duplicates,
because it swallows them instead of returning an error.
The only solution then is to serialize to string and try to deserialize
again.
This allows deserializing all the `*EventContent` types into a parent `Any{...}EventContent`, assuming we know the type of the underlying event.
Required for serializing/deserializing the content of events we'd like to send, across application restarts, as in https://github.com/matrix-org/matrix-rust-sdk/issues/3361 for the Rust SDK.
---
* events: add deserialize_with_type to all the *EventContent types
* events: add smoke test for deserializing an event content with a type
* events: add a test for deserializing a secret storage key event content
* events: add fix for correctly matching events with a type fragment
* Address review comments.
- Don't instruct docs.rs to set it, it does so by default now:
https://github.com/rust-lang/docs.rs/pull/2390
- Because of that, check-cfg also recognizes it and does not need
extra configuration either.
Some servers use an integer to represent e.g. `1` for the order, instead of the double representation (that would be `1.` or `1.0)`. This makes it possible to parse such values as integers too, since they're technically not double. Implementing `visit_u64` and `visit_i64` covers all the smaller sizes too, so I've implemented only that here.