15 Commits

Author SHA1 Message Date
Devin Ragotzy
9bc257b19e
Use proc_macro_crate name in the Event derive 2020-08-11 23:47:34 +02:00
Devin Ragotzy
cfe62f27d0
Re-export ruma-events-macros and deps in ruma-events
This also adds the dependency and function to find crate name at macro
expansion time.
2020-08-11 23:47:34 +02:00
Jonas Platte
1fbf05d71f
Fix some bad formatting 2020-08-08 21:52:58 +02:00
Devin Ragotzy
606f988ed8 Add doc comments for cmp traits and use unambiguius paths 2020-08-03 17:39:50 +02:00
Devin Ragotzy
3f370c5f1b Add PartialEq/Eq and PartialOrd/Ord to the event structs with event_ids 2020-08-03 17:39:50 +02:00
Devin Ragotzy
b6c289c3d2 Clean up before starting to implement eq/ord trait 2020-08-03 17:39:50 +02:00
Devin Ragotzy
4be63127f7
Add into_full_event and From<> impls to convert between sync and full events 2020-07-24 14:45:38 +02:00
Devin R
3329dc7345 Fix clippy warnings in identifiers and events-macros 2020-07-23 15:01:12 +02:00
Devin R
2e1e63671d Turn long matches! into is_redacted EventKindVariation method 2020-07-23 15:01:12 +02:00
Devin R
a39c0106d4 Generate EventKind/Variation pair from Event derive input 2020-07-23 15:01:12 +02:00
Devin R
6f69a6fe76
Fix redacted aliases event deserialization 2020-07-15 17:10:47 +02:00
Ragotzy.devin
5e428ac95a
Add support for redacted events
* 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
2020-07-11 14:59:36 +02:00
Ragotzy.devin
184aafa5f6
Revert " Remove event_enum! and only use event_content_enum"
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
2020-06-19 11:36:53 +02:00
Ragotzy.devin
f4665761be
Fix failing deserialization when encountering an unknown field 2020-06-16 00:34:58 +02:00
Jonas Platte
0a788c1273
Integrate ruma-events 2020-06-10 22:20:41 +02:00