At the same time, this commit makes `ServerName` a newtype around str so
other identifier types can borrow out their server name part as a
`&ServerName`. This technique works for `ServerName` because it keeps no
additional metadata. For the other identifier types to support being
created in borrowed form from a string slice, custom DSTs first have to
be added to Rust.
* Generate redacted event enums and implement corresponding event structs
* Enable the *EventContent derives to generate redacted events
Most redacted event code is now generated by the *EventContent derive
macro. The exception are any content structs with the custom_redaction
attribute. This leaves implementing up to the user.
* Add redact method to Redaction/CustomEventContent
* Add accessor methods for redacted event enums
* Add RedactedEventContent trait and super traits to match EventContent
`get_tags` route response was adding the `tags` property twice, which is
not the expected behaviour. This is an example of the previous
serialization of the `get_tags` route:
`{"tags":{"tags":{"u.example":{"order":0.55},"u.another":{"order":0.11}}}}`
The new serialization removes the outer `tags` property.
* Conditionally emit tokens for content enum in event_enum! and the path
for each Any*Event variant contents.
* Add tests for redaction events now that they are part of Any*Event enums.
* Fix any tests that used Any*EventContent.
This removes ruma-serde's dependency on dtoa. Removing deserialization
support could be done later, but would actually make the code more
complex, so is left out for now.
This reverts commit 2a91dc1eb7215a762bd2204bc103ef172258d2d9. Also
* Add back type defs and Any*Event enums
* Move EventDeHelper and from_raw_json_value to lib make pub so event_enum! macro can use them and test.
* Fix Any*Event enum deserialization error
* Remove event_content_enum! macro and ruma-events-macros/src/content_enum.rs
* Use serde's IgnoreAny to skip Unknown field's value
* Clean up imports and test names for state_event