271 Commits

Author SHA1 Message Date
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
cbf71d848a identifiers: Make parse return owned IDs and add parse_box 2022-04-20 10:39:36 +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
ab94bed1dc api: Change Incoming derive to use owned ID types
… except for a few ID types that don't have an owned variant yet.
2022-04-20 10:39:36 +02:00
Jonas Platte
6434fd8c92 identifiers: Add conversions from strings to owned ID types 2022-04-20 10:39:36 +02:00
Jonas Platte
f6c74fa23a identifiers: Add manual Clone impl for owned ID types
… to get rid of unnecessary bounds.
2022-04-20 10:39:36 +02:00
Jonas Platte
ae095cc037
macros: Expand IdZst derive to generic types
… and use it for KeyId.
2022-04-14 13:57:02 +02:00
Jonas Platte
5d8f6748e6
identifiers: Add extra PartialEq implementations for owned ID types 2022-04-14 11:37:35 +02:00
Jonas Platte
d36157a57c
identifiers: Add Display implementation for owned types 2022-04-14 11:37:35 +02:00
Jonas Platte
ed92a4fbd7
identifiers: Implement From<&Id> for String 2022-04-14 11:37:35 +02:00
Jonas Platte
d5656f3399
identifiers: Rename from_owned to from_box 2022-04-14 11:37:35 +02:00
Jonas Platte
f658487c50
identifiers: Replace most macro_rules! code with proc-macro code 2022-04-14 11:16:01 +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
Jonas Platte
7de3b4b649
events: Rework the event enum hierarchy 2022-04-05 14:29:17 +02:00
Jonas Platte
f540bbbc99
events: Remove some accessor functions
They will no longer make sense with the new enum hierarchy.
2022-04-05 14:29:17 +02:00
Jonas Platte
51244d5ae7
events: Fix name of internal helper method 2022-04-05 14:29:17 +02:00
Jonas Platte
d87874314b
events: Add 'Original' prefix to unredacted types with a redacted form 2022-04-05 14:29:17 +02:00
Jonas Platte
d614ad1422
macros: Remove PossiblyRedacted event enums 2022-04-05 14:29:17 +02:00
Jonas Platte
1415e32a1d macros: Remove some unnecessary short-circuiting in event proc-macros 2022-04-02 20:31:37 +02:00
Jonas Platte
634f93c985 macros: Improve error handling 2022-04-02 20:31:37 +02:00
Jonas Platte
a50b2d313a events: Remove unnecessary IdentFragment::span implementations 2022-04-02 20:31:37 +02:00
Jonas Platte
c787c8351e macros: Move EVENT_FIELDS out of util.rs
It was only used by the event_enum! macro anyways.
2022-04-02 20:31:37 +02:00
Jonas Platte
a4aa7e0912
macros: Fix missing type qualification in Event derive macro 2022-03-31 18:42:27 +02:00
Jonas Platte
9f56e6e497
events: Rename HierarchySpaceChildStateEvent => HierarchySpaceChildEvent 2022-03-31 18:42:27 +02:00
Jonas Platte
05ad164d21
macros: Fix errors from unused serde attributes with only server feature active 2022-03-25 12:26:52 +01:00
Jonas Platte
7a5be040fd
macros: Reduce codegen by feature-gating Serialize and Deserialize derives
… this makes it faster to compiler ruma-*-api with either the client or
server feature inactive.
2022-03-24 18:08:21 +01:00
Jonas Platte
7fbb28f223
macros: Finish support for variable event types 2022-03-23 21:17:18 +01:00
Jonas Platte
a860fdaa86
macros: Allow variable event types in event_enum!
… the generated `*EventType`s aren't correct yet though.
2022-03-23 21:17:18 +01:00
Jonas Platte
ef9c84716c
common: Allow variable event types in EventContent derive 2022-03-23 21:17:18 +01:00
Jonas Platte
54f9db8ccc macros: Consistently create Incoming* types from Incoming derive
… as a type alias if there are no lifetime generics on the input type.
2022-03-22 13:19:03 +01:00
Jonas Platte
5a791b3c6e macros: Simplify Incoming derive implementation 2022-03-22 13:19:03 +01:00
Jonas Platte
a6a530dcc8 serde: Rename derive macro Outgoing to Incoming
All it does now is generate `Incoming{Self}` types.
2022-03-22 13:19:03 +01:00
Jonas Platte
5cf42f3a86 serde: Remove the Outgoing trait 2022-03-22 13:19:03 +01:00
Jonas Platte
4e7eeb8aa4 macros: Slightly simplify generated API trait impls 2022-03-22 13:19:03 +01:00
Jonas Platte
e3a8b6b81f macros: Don't generate unused Outgoing structs
They are only needed when the server feature is active.
2022-03-22 13:19:03 +01:00
Kévin Commaille
af61a62202
macros: Add alias attribute to ruma_enum 2022-03-18 12:38:47 +01:00
Jonas Platte
ada3108a96
common: Move prev_content into unsigned 2022-03-16 16:30:29 +01:00
Jonas Platte
e9c60cf36c
Deprecate the EventType enum 2022-03-16 12:20:18 +01:00
Jonas Platte
e86ee7dd31
macros: Silence deprecation warnings in generated code 2022-03-16 12:20:18 +01:00
Jonas Platte
cdc6b9a2aa
macros: Add missing automatically_derived attributes 2022-03-16 12:20:17 +01:00
Jonas Platte
6f6e7ca68e
macros: Simplify *EventType generation 2022-03-16 12:20:17 +01:00
Jonas Platte
1b24a76967
macros: Refactor event type to type name conversion 2022-03-16 12:20:17 +01:00
Jonas Platte
862ee426ab
macros: Fix docs 2022-03-16 12:20:17 +01:00
Jonas Platte
6dc0bf248b
Use *EventType enums in more places 2022-03-16 12:20:17 +01:00
Jonas Platte
0f18deae1d
macros: Consistently use syn::Result type alias 2022-03-16 12:20:17 +01:00