5209 Commits

Author SHA1 Message Date
Jimmy Cuadra
9a56e2b0a6 Add tests for canonical JSON. 2019-07-08 22:01:15 -07:00
Jimmy Cuadra
07295b11bb Rename Signatures SignatureMap. 2019-07-08 21:22:17 -07:00
Jimmy Cuadra
97ee073e11 Split the library into modules. 2019-07-08 21:10:50 -07:00
Jimmy Cuadra
03fcf7281d Use constants from base64. 2019-07-08 20:45:27 -07:00
Jimmy Cuadra
302e401a80 Remove unnecessary constructor for Ed25519Verifier. 2019-07-08 18:53:29 -07:00
Jimmy Cuadra
6ffd73b312 Make Error::new private to the crate. 2019-07-08 18:51:15 -07:00
Jimmy Cuadra
c0d10881a2 Implement Clone and PartialEq for all types.
See https://github.com/briansmith/ring/issues/859 for background.
2019-07-08 18:47:11 -07:00
Jimmy Cuadra
e7e4d04244 Undo the change of storing FilterDefinition in a box.
On second thought, it doesn't make sense to change this just cause of a
clippy warning. We'll wait and see if it ever causes and real problems
before making the API less consistent just to avoid a potential space
saving issue.
2019-07-08 14:24:07 -07:00
Jimmy Cuadra
c25d76e20f Treat deserialization failure as a validation failure.
If a ruma-events type fails deserialization, but the input was valid
JSON, this should be treated as a validation failure instead of a
deserialization failure. In this case, attempt to deserialize the json
into a `serde_json::Value`, and only return a deserialization error if
that fails.
2019-07-08 03:34:42 -07:00
Jimmy Cuadra
733dfa7ef3 Implement FromStr and TryFrom<&str> for content types. 2019-06-28 12:47:41 -07:00
Jimmy Cuadra
b0c1997016 Fix typo in Cargo.toml. 2019-06-24 13:02:54 -07:00
Jimmy Cuadra
065cb770af Remove unnecessary for loops. 2019-06-22 00:21:23 -07:00
Jimmy Cuadra
a65a618930 Run rustfmt. 2019-06-21 17:18:06 -07:00
Jimmy Cuadra
db70792f03 Alphabetize struct fields. 2019-06-21 17:14:08 -07:00
Jimmy Cuadra
3bad559980 Add serialization and deserialization tests. 2019-06-21 17:00:28 -07:00
Jimmy Cuadra
e34ea05445 Skip serializing options. 2019-06-21 16:33:53 -07:00
Jimmy Cuadra
d9039db8df Convert from JSON using impl FromStr and impl TryFrom<&'a str> rather than an inherent from_str method. 2019-06-20 22:40:14 -07:00
Jimmy Cuadra
e13acb4d7d Fix copy/paste error. 2019-06-20 17:08:38 -07:00
Jimmy Cuadra
553d9c05cd Add support for events with custom types. 2019-06-20 17:05:30 -07:00
Jimmy Cuadra
44a13e6515 Add span information to token streams when possible. 2019-06-19 23:50:06 -07:00
Jimmy Cuadra
52754f617c Import Event trait in Serialize impl so event_type can be called. 2019-06-19 23:36:16 -07:00
Jimmy Cuadra
f663c79250 Remove extra commas from generated code. 2019-06-19 23:36:01 -07:00
Jimmy Cuadra
ce2a3817cf Rename ParseError to FromStrError and add InvalidEvent. 2019-06-19 22:45:20 -07:00
Jimmy Cuadra
4423275ce2 Implement RoomEvent and StateEvent when applicable. 2019-06-19 22:40:58 -07:00
Jimmy Cuadra
be0f1d0363 Add inherent impl with from_str method. 2019-06-19 21:14:49 -07:00
Jimmy Cuadra
78e25552fb Implement Serialize and Event. 2019-06-19 16:52:54 -07:00
Jimmy Cuadra
3b65905784 Generate content types and raw module. 2019-06-19 16:08:43 -07:00
Jimmy Cuadra
a5834ea192 Combine and sort common and custom fields using a Vec<Field>. 2019-06-19 15:40:29 -07:00
Jimmy Cuadra
2f54ee3e32 Implement generation of structs. 2019-06-18 17:54:50 -07:00
Jimmy Cuadra
48d6ef7ead Split parsing and generation into separate modules. 2019-06-18 16:59:48 -07:00
Jimmy Cuadra
65bd8e86cc ruma-events-macros 2019-06-18 16:34:45 -07:00
Jimmy Cuadra
e9df06b30b Turn off nightly feature for proc-macro2. 2019-06-17 17:19:31 -07:00
Jimmy Cuadra
0f3fbec8b7 Add crates.io categories. [ci skip] 2019-06-16 16:52:28 -07:00
Jimmy Cuadra
5461c20875 Add crates.io categories. [ci skip] 2019-06-16 16:51:11 -07:00
Jimmy Cuadra
9a5858cae8 Add crates.io categories. [ci skip] 2019-06-16 16:50:06 -07:00
Jimmy Cuadra
2eeb90ed55 Add crates.io categories. [ci skip] 2019-06-16 16:46:02 -07:00
Jimmy Cuadra
1b0be0d0e7 Add crates.io categories. [ci skip] 2019-06-16 16:45:02 -07:00
Jimmy Cuadra
aa9d546b1b Add crates.io categories. [ci skip] 2019-06-16 16:42:46 -07:00
Jimmy Cuadra
77e5976ba6 Add crates.io categories. [ci skip] 2019-06-16 16:41:59 -07:00
Jimmy Cuadra
a16eb7cfe1 Use js_int types for numbers.
See https://github.com/ruma/ruma-events/issues/27 for rationale.
2019-06-16 16:32:56 -07:00
Jimmy Cuadra
c3f48c5be3 Use js_int types for numbers.
Closes #27.
2019-06-16 16:16:37 -07:00
Jimmy Cuadra
bc7683af96 Bump version to 0.13.1. 2019-06-16 01:30:42 -07:00
Jimmy Cuadra
9506c565e0 Add support for room version 5. 2019-06-16 01:29:54 -07:00
Jimmy Cuadra
04cdc96b8b Add m.push_rules. 2019-06-15 03:26:50 -07:00
Jimmy Cuadra
9b17d5729a Use a consistent style for the name of the library. 2019-06-15 00:07:44 -07:00
Jimmy Cuadra
f4b7204f31 Derive PartialEq where possible. 2019-06-15 00:03:32 -07:00
Jimmy Cuadra
a0ee826828 Add E2EE events to EventType and collections types. 2019-06-14 23:12:18 -07:00
Jimmy Cuadra
a0a9799c81 Add events from the end-to-end encryption module. 2019-06-14 22:14:11 -07:00
Jimmy Cuadra
12212789b3 Future-proof enums with a __Nonexhaustive variant.
This can be replaced with the #[non_exhaustive] compiler attribute once
it's stabilized.
2019-06-14 18:18:47 -07:00
Jimmy Cuadra
add7ef0d8b Add blank lines to make type definitions easier to read. 2019-06-14 14:02:03 -07:00