Jonas Platte
9c65a7dcae
events: Use input visibility for generated types in EventContent derive
2023-02-07 20:55:53 +01:00
Jonas Platte
19006cd047
Clean up code blocks in doc strings
2023-02-01 16:58:47 +01:00
Jonas Platte
62ed200a56
events: Use possibly-redacted content for StrippedStateEvent
2023-01-16 21:28:53 +01:00
Jonas Platte
2eba14f0cc
events: Rework the content traits
2023-01-16 21:28:53 +01:00
Jonas Platte
49a0650f62
events: Remove EventKind
...
The EventType associated type on EventContent practically provides the
same information.
2023-01-16 21:17:00 +01:00
Jonas Platte
7de5893b83
common: Use quoted string as Debug representation of event types
2023-01-13 12:54:28 +01:00
Jonas Platte
3a722965f5
macros: Refactor event content generation
2023-01-10 11:46:49 +01:00
Jonas Platte
68a596dbc3
events: Remove RedactedEventContent trait
2023-01-10 11:46:49 +01:00
Kévin Commaille
1d8ea75f6f
events: Remove EventContent::from_parts
2023-01-10 11:37:31 +01:00
Kévin Commaille
dc591647f8
events: Remove StateUnsignedFromParts
...
Replace it with a bound on DeserializeOwned
2023-01-10 11:37:31 +01:00
Kévin Commaille
97b212795a
events: Create EventContentFromType
...
Implement it for:
- event contents that implement Deserialize
- event contents with event types with a suffix
- custom event contents
2023-01-10 11:37:31 +01:00
Kévin Commaille
ca78825e94
events: rename RoomEventType to TimelineEventType
2023-01-03 10:36:13 +01:00
Kévin Commaille
cd74cdcc0e
events: Generate PossiblyRedacted type for original state events
...
Fix deserialization of redacted prev_content
Can be overriden with the `custom_possibly_redacted` attribute
Co-authored-by: Jonas Platte <jplatte@element.io>
2023-01-03 10:28:40 +01:00
Kévin Commaille
9d8c9c477f
events: Move Unsigned type to new OriginalStateEventContent trait
...
Only original events require it.
2022-12-23 17:55:03 +01:00
Kévin Commaille
e4678284ca
events: Add accessor for AnyFullStateEventContent's event type
2022-12-20 10:46:34 +01:00
Kévin Commaille
baaf73adbc
events: Add accessors for state events' original or redacted content
2022-12-19 13:13:12 +00:00
Jonas Platte
190205cfb1
events: Remove Option around BundledRelations
...
… because the type has its own empty state (all fields being None).
2022-12-15 16:46:12 +01:00
Jonas Platte
ad3c27d927
events: Make redacted_because non-optional in RedactedUnsigned
2022-12-15 12:47:27 +01:00
Jonas Platte
cdabe8e52d
events: Remove Serialize impls for all event types except ToDeviceEvent
2022-12-15 10:41:30 +01:00
Jonas Platte
675e6f43cd
events: Remove the Redact trait
...
It has not proven to be useful, being used by no downstream project.
2022-12-14 12:49:15 +01:00
Jonas Platte
a5c5b0b137
Make clippy happy
2022-12-09 11:45:04 +01:00
Kévin Commaille
61a9d65b71
events: Rename events::relation::Relations to BundledRelations
2022-11-25 22:33:37 +01:00
Kévin Commaille
dab2956039
events: Use a struct for parsing of EventContent attributes
2022-11-12 11:14:04 +01:00
Jonas Platte
94990f60f2
events: Don't skip serializing empty content of redacted events
2022-11-09 17:11:50 +01:00
Jonas Platte
c7e84c5249
Fix clippy lints
...
Automated using `cargo clippy --fix`.
2022-10-26 13:38:29 +02:00
Kévin Commaille
ec853e968a
events: Generate structs without relation for events that can be replaced
2022-10-17 20:27:49 +02:00
Jonas Platte
028eb8a457
events: Remove deprecated API
2022-09-22 11:50:22 +02:00
Jonas Platte
97387f36c1
macros: Fix outdated documentation
2022-09-22 11:47:32 +02:00
Jonas Platte
fa61cc1248
events: Add relations accessors to event enums
2022-09-16 11:34:54 +02:00
Jonas Platte
956871cfa6
macros: Rename is_room to is_timeline
2022-09-16 11:28:16 +02:00
Jonas Platte
aa8e48d1c3
events: Allow customizing the unsigned type of state events
2022-09-12 13:10:10 +02:00
Jonas Platte
35d8bdd5a1
events: Move StateUnsigned::_from_parts into a trait
2022-09-12 12:03:29 +02:00
Jonas Platte
674137c41d
events: Use CanBeEmpty trait for skipping unsigned serialization
2022-09-12 11:44:05 +02:00
Jonas Platte
24d0b2e2bb
events: Implement content sub-traits for event content enums
2022-09-06 18:35:43 +02:00
Jonas Platte
7957dd6adf
events: Replace generic "alias" trait implementations by individual ones
...
… so that rustdoc lists types implementing them properly.
2022-09-05 11:16:30 +02:00
Jonas Platte
8912182c56
Increase usage of implicit named arguments in format strings
2022-06-03 10:06:28 +02:00
Jonas Platte
73c2963ebd
Enforce consistent semicolons after ()
-typed expressions in blocks
2022-06-03 08:40:16 +02:00
Kévin Commaille
74423b7a4e
events: Split EventMeta between struct and field attributes
2022-05-16 17:08:36 +02:00
Kévin Commaille
1073530ac6
events: Add support for type aliases
...
Allow to use unstable types
2022-05-16 13:24:25 +02:00
Kévin Commaille
abf735093c
events: Fix serde of event types with suffix
2022-05-09 10:41:22 +00:00
Kévin Commaille
3ddc4de758
macros: Require event module path for event_enum
2022-05-04 13:11:54 +02:00
Jonas Platte
d412a80127
events: Add original_content accessor for possibly-redacted event enums
2022-04-28 16:32:42 +02:00
Kévin Commaille
5c0a91fae0
events: Implement From<MessageLikeEventType | StateEventType> for RoomEventType
2022-04-28 10:37:27 +02:00
Naman Sandilya
0cdd6a7b0f
Return owned value for origin_server_ts accessors
2022-04-27 10:30:24 +00:00
Jonas Platte
ae7461622c
events: Update state key types for all state events
...
… and make it mandatory to specify for state events.
2022-04-21 11:16:38 +02:00
Jonas Platte
d8b7886382
events: Allow state key type to be customized by content type
2022-04-21 11:16:38 +02:00
Jonas Platte
da222a87c9
macros: Remove trait import
2022-04-21 11:16:38 +02:00
Jonas Platte
d855ec33d6
identifiers: Update ToOwned implementations to use new types
...
… and a lot of changes that cascaded from that.
2022-04-20 10:39:36 +02:00
Jonas Platte
1db716f643
events: Add transaction_id accessor to applicable event enums
2022-04-13 16:47:42 +02:00
Kévin Commaille
688d5bf47a
docs: Improve string enums documentation
...
Mention the conversion from string.
2022-04-10 14:48:09 +02:00