52 Commits

Author SHA1 Message Date
Ragotzy.devin
c2b1c9897b
Any event enum macro implementation (also generates event content enums) 2020-06-09 23:31:31 +02:00
Ragotzy.devin
1fdf986bae
Add RedactionEvent and convert RedactionEventContent to struct def
PresenceEventContent and RedactionEventContent now also derive *EventContent
2020-06-09 12:43:21 +02:00
Jonas Platte
1373d4daaf
Rename ephemeral_event to ephemeral_room_event 2020-06-09 01:56:20 +02:00
Ragotzy.devin
6a0a10fcff
Add BasicEventContent derive and create AnyBasicEventContent enum
Also remove PresenceEventContent derive and expand code gen
2020-06-08 23:51:22 +02:00
Ragotzy.devin
d38e385aab
Remove unused imports and fix serde::ser::Error trait not being in scope 2020-06-08 14:40:59 +02:00
Ragotzy.devin
800fba7c32
Implement PresenceEvent and EphemeralEvent
* Add derive for PresenceEventContent and create struct AnyPresenceEventContent
since there is only one content type
* Add derive for Ephemeral event and create enum AnyEphemeralEventContent, convert
receipt and typing to use derive(EphemeralEventContent) over ruma_api!
2020-06-07 22:56:43 +02:00
Ragotzy.devin
ef3a6787a0
Remove src/from_raw.rs and ruma-events-macro/src/from_raw.rs 2020-06-07 22:21:04 +02:00
Jonas Platte
aa7a54015c
Rename ruma_content_collection to ruma_content_enum 2020-06-07 15:54:23 +02:00
Ragotzy.devin
0a91ac5126
Remove raw mod and TryFromRaw/FromRaw, derive Deserialize for event content types 2020-06-07 01:18:42 +02:00
Ragotzy.devin
2c8d609095
Add Event derive macro 2020-06-07 01:18:42 +02:00
Jonas Platte
6a844625fc
Clean up macro crate attributes 2020-06-07 01:18:42 +02:00
Jonas Platte
76cd387506
Remove support for state events in ruma_event! 2020-06-07 01:18:42 +02:00
Jonas Platte
158287204b
Fix a typo 2020-06-07 01:18:41 +02:00
Ragotzy.devin
33ac5267a9
Implement MessageEvent and AnyMessageEventContent 2020-06-07 01:18:34 +02:00
Ragotzy.devin
80ff10ae6a
Move event content collection trait impl's into macro code
* Move the EventContent and content marker traits into macro.
* Move the raw AnyStateEventContent enum and RawEventContent trait into macro, generate all of the AnyStateEventContent type and impls needed for raw.
* Factor out raw mod codegen to seperate fn, add docs to codegen enum + variants, remove unused imports
2020-06-07 01:11:15 +02:00
Jonas Platte
5091b9a9a8
Integrate generic event types and EventContent trait with TryFromRaw 2020-06-07 01:11:15 +02:00
Ragotzy.devin
3814690b29
event_content_collection!: implement parsing input and generating an enum 2020-06-07 01:11:15 +02:00
Ragotzy.devin
7ec162678e
Implement first trybuild tests
and use a dedicated InvalidEvent constructor fn in EventContent derives
2020-06-07 01:11:13 +02:00
Ragotzy.devin
0c0dafa2c5
Move event content derives into one place and share code 2020-06-07 01:10:55 +02:00
Ragotzy.devin
ef6e2e7023
Add derive macro for StateEventContent 2020-06-07 01:02:49 +02:00
Ragotzy.devin
f0c94958fa
Move raw mod into FromRaw derive 2020-06-07 01:02:49 +02:00
Ragotzy.devin
1a9b0f3e8b
Add StateEvent<C> and AnyStateEvent 2020-06-07 01:02:49 +02:00
Ragotzy.devin
3d01bfa96d
Remove Event, RoomEvent and StateEvent traits 2020-06-07 01:02:49 +02:00
Devin R
54fcc36735 remove allow clippy::identity_conversion 2020-05-23 13:31:14 +02:00
Jonas Platte
ca5c65ef10
Revise trait implementations 2020-05-02 14:15:13 +02:00
Jonas Platte
f783ea6167
Fix unsigned field deserialization 2020-04-28 00:30:05 +02:00
Jonas Platte
55340d18c8
Add struct UnsignedData and update unsigned fields to use it 2020-04-28 00:03:48 +02:00
Jonas Platte
eb3a3e2163
Replace EventResult with EventJson, simplify InvalidEvent 2020-04-22 21:24:39 +02:00
Jonas Platte
2480bb292a
Replace HashMap with BTreeMap 2020-04-19 17:46:36 +02:00
Jonas Platte
dc0a9f88ba
Change timestamp types from UInt to SystemTime 2020-04-17 22:43:30 +02:00
Jonas Platte
cba7b161e9
Update unsigned field's type from Option<Value> to Map<String, Value>
* it's guaranteed to always be an object
* `Option` isn't needed because the distinction empty object / missing
  field is not of interest
2020-03-29 15:37:57 +02:00
Akshay
f09ab98f17
Remove manual Serialize impl, use derive macro instead 2020-03-29 13:41:42 +02:00
Ragotzy.devin
8ea971b082
Derive Serialize in ruma_events!, use json EventType string for event_type field
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-03-24 14:25:50 +01:00
Ragotzy.devin
14df832005
Remove special handling of custom events 2020-03-24 11:31:47 +01:00
Jonas Platte
5a79b766c7
Revert "Remove special handling of custom events"
This reverts commit 539dd5f31dff172b5d6559378e33982d0a0c3333.
2020-03-24 11:31:36 +01:00
Ragotzy.devin
539dd5f31d
Remove special handling of custom events
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-03-24 11:27:55 +01:00
Jonas Platte
0c6dd0ba32
Simplify proc_macro tests
… by moving them from ruma-events-macros to ruma-events and updating the
macros to work in different contexts (without items like FromRaw being
available at the calling crate's root)
2020-03-17 13:10:40 +01:00
Jonas Platte
016659a99c
Split impl FromRaw generation into its own macro 2020-03-16 23:27:32 +01:00
Jonas Platte
ddbb06f21d
Clean up code gen a bit 2020-03-16 21:22:56 +01:00
Jonas Platte
8a9bbb8c83
Don't deny(warnings) 2020-03-16 21:13:44 +01:00
stoically
3128351031
Rename event_type when deserializing custom events 2020-01-01 20:20:13 +01:00
Jonas Platte
370c56ef31
Use quote::format_ident! 2019-12-13 20:42:20 +01:00
Jonas Platte
b9f5fd796e
Bump MSRV to 1.36.0 2019-11-24 15:43:13 +01:00
Jonas Platte
cb4bddf60a Disable clippy lint use_self for ruma-events-macros 2019-10-23 03:05:02 +02:00
Jonas Platte
60c817e1b0 Restore Rust 1.34.2 compatibility 2019-10-23 02:09:34 +02:00
Jonas Platte
c925cd13f1 Update documentation 2019-10-23 01:42:06 +02:00
Jonas Platte
09b8de5b6e Introduce FromRaw in addition to TryFromRaw 2019-10-15 20:26:30 +02:00
Jonas Platte
a6c34596d7 Rename EventResultCompatible to TryFromRaw 2019-10-15 20:05:46 +02:00
Jonas Platte
c20d79db7d Inline try_from method into EventResultCompatible 2019-10-08 21:28:18 +02:00
Jonas Platte
05562a48a3 WIP 2019-09-29 13:30:51 +02:00