64 Commits

Author SHA1 Message Date
Jonas Platte
f130d09daa
events: Remove Serialize implementations for event enums 2022-02-12 01:52:53 +01:00
Jonas Platte
b08e8cff9d
events: Remove custom module
… and shuffle things around so there's still a content type that can be
used for _Custom event enum variants.
2022-02-08 19:12:19 +01:00
Jonas Platte
39041286b9
Move from_raw_json_value to ruma-serde
… and remove unnecessary copies of it.
2022-02-02 20:58:47 +01:00
Jonas Platte
392cf23d4b
events: Don't store data of unknown events in enums 2022-01-29 02:08:33 +01:00
Jonas Platte
38ba38228a
events: Use PrivOwnedStr for #[doc(hidden)] event_type field 2022-01-29 01:31:18 +01:00
Jonas Platte
e387abda81
events: Raise an error when trying to serialize _Custom variant of event content enum 2022-01-17 00:43:00 +01:00
Jonas Platte
2d4dbfe42f
identifiers: Make RoomId a DST 2021-11-26 00:04:28 +01:00
Jonas Platte
fd15dcda9f
events-macros: Get rid of lots of unwrapping 2021-10-07 00:13:57 +02:00
Jonas Platte
9103ad74bb
events-macros: Reorganize event impl generation 2021-10-07 00:07:15 +02:00
Jonas Platte
7a4af83207
events-macros: Finish codegen reorganization 2021-10-06 23:49:39 +02:00
Jonas Platte
6d3d6c92db
events-macros: Refactor expand_redacted_enum 2021-10-06 23:09:23 +02:00
Jonas Platte
c14a0edf15
events-macros: Refactor accessor method codegen 2021-10-06 23:03:51 +02:00
Jonas Platte
4229adfc05
events-macros: Further re-organize enum codegen 2021-10-06 22:54:29 +02:00
Jonas Platte
f699a52983
events-macros: Partial re-organize enum codegen 2021-10-06 22:17:47 +02:00
Jonas Platte
0a679816a9
events-macros: Pass EventKind and EventKindVariation by value 2021-10-06 22:08:11 +02:00
Jonas Platte
47d1f30be8
events-macros: Simplify expand_redacted_event_enum 2021-10-06 21:30:26 +02:00
Jonas Platte
be549e4000
events-macros: Rename name => kind for clarity 2021-10-06 21:11:17 +02:00
Jonas Platte
653f03325b
events-macros: Shorten expand_event_enums through import-rename 2021-10-06 20:52:56 +02:00
Jonas Platte
ce8cbff3fd
events-macros: Improve function / variable names 2021-10-06 20:51:19 +02:00
Jonas Platte
4e2fdcb990
events: Remove redacted event content enums
They weren't being used anywhere.
2021-10-06 20:33:40 +02:00
Jonas Platte
04080085f9
events: Include all event type segments in Rust type names 2021-10-02 21:25:21 +02:00
Jonas Platte
4e2b93617a
events-macros: Fix confusing variable name 2021-10-02 13:48:23 +02:00
Jonas Platte
c807f9f43d
events: Add redacted redaction event types 2021-10-02 13:48:22 +02:00
Jonas Platte
e41abbb56b
events: Implement Redact for event structs
… it was only implemented for the enums before.
2021-10-02 01:19:36 +02:00
Jonas Platte
3b786d8f78
events-macros: Simplify redaction-related code 2021-10-02 00:47:19 +02:00
Jonas Platte
ec92349496
events-macros: Add missing automatically_derived attribute 2021-10-01 20:17:47 +02:00
Jonas Platte
651741f482
events-macros: Fix unqualified usage of From 2021-10-01 20:12:49 +02:00
Jonas Platte
8df746d442
events-macros: Simplify conversion code generation 2021-10-01 20:05:32 +02:00
Jonas Platte
ab6a364e42
events: Use type aliases inside enums 2021-10-01 19:49:25 +02:00
Jonas Platte
0101e110f8
Rename *ToDeviceEventContent structs to ToDevice*Content 2021-10-01 16:48:45 +02:00
Jonas Platte
bb9f95224c
events: Remove RedactedStrippedStateEvent
Stripped state events are never redacted.
2021-09-15 20:36:20 +02:00
Jonas Platte
f3e52e4bc3
events: Don't serialize event_type inside content for unsupported events 2021-08-22 14:12:36 +02:00
Jonas Platte
18127be03c
events-macros: Revert recent addition of unneeded allow(clippy::lints) 2021-08-22 14:10:15 +02:00
Jonas Platte
77cf085ab9
events: Don't store extra fields for unknown events in content enums 2021-08-22 13:54:20 +02:00
Jonas Platte
1c361c2895
events-macros: Reduce amount of newlines 2021-08-22 13:29:03 +02:00
Adam
d746244241
events: Generate From impls for event (content) enums 2021-08-17 15:44:33 +00:00
Jonas Platte
3b0afb520a
events: Optimize deserialization helpers 2021-08-12 20:46:15 +02:00
Jonas Platte
11fea54173
events: Disallow more than one event kind attribute
… and also raise an error if there's multiple type attributes (extra
ones used to be ignored).
2021-08-11 19:19:16 +02:00
Devin Ragotzy
db755f994e
events: Make all pub enums non_exhaustive 2021-08-10 15:22:26 +02:00
Devin Ragotzy
3101be1f99
Add macro-braces, disallowed-type and import-rename clippy lints 2021-07-22 14:34:30 +02:00
Devin Ragotzy
e05aad184e events: Make all pub structs non_exhaustive 2021-06-18 20:53:06 +02:00
Jonas Platte
349a57ffc7
events: Rename & hide event enum Custom variant 2021-06-17 19:43:23 +02:00
Jonas Platte
de737f30e7
events: Refactor macro code
Use Option::zip which was not possible with the previous MSRV.
2021-06-17 19:43:22 +02:00
Jonas Platte
e622803679
Use bool::then to simplify some code 2021-06-17 19:43:22 +02:00
Jonas Platte
ed9138796a
events: Refactor marker trait code generation 2021-05-15 15:18:22 +02:00
Jonas Platte
ab850d8237
events: Remove marker trait
It was not used anywhere.
2021-05-15 15:06:31 +02:00
Jonas Platte
37899db3c5
events: Borrow raw JSON in EventContent::from_parts 2021-05-15 15:02:27 +02:00
Jonas Platte
60d4ea027f
Use serde_json::Result alias 2021-05-15 15:02:02 +02:00
Devin Ragotzy
34134267c6
events: Generate redact method for content enums
… and remove redacted content structs non-room events
2021-05-15 12:51:20 +00:00
Jonas Platte
702b619417
events: Introduce Redact trait 2021-05-15 13:26:05 +02:00