Kévin Commaille
945e085c7a
common: Add tests for push rules
2021-03-22 20:42:25 +01:00
Kévin Commaille
c8c45d10fa
common: Replace push rule kinds types with AnyPushRule variants
2021-03-22 20:42:25 +01:00
Kévin Commaille
b79ef0303a
Move common::push::AnyPushRule to client_api::r0::push::PushRule
2021-03-22 20:42:25 +01:00
Kévin Commaille
22f7f28e1b
common: Replace BTreeSet by IndexSet in push::Ruleset.
...
Keeps the JSON ordering for priority.
IndexSet are hashed by `rule_id` so its uniqueness is enforced.
A rule can be fetched by its `rule_id`.
2021-03-22 20:42:25 +01:00
Devin Ragotzy
8fad462d8c
Fix push rule precedence when converting to RulesIter
2021-01-30 18:00:57 +01:00
Jonas Platte
5562a23aaa
Move Raw, Outgoing and all macro code from ruma-common to ruma-serde
2020-11-28 03:45:39 +01:00
Ana Gelez
aab6ed9c94
Hide RulesetMember::add_to in the docs
2020-11-27 20:53:51 +01:00
Ana Gelez
483fe8f940
Run cargo fmt
2020-11-27 20:53:51 +01:00
Ana Gelez
57efd8cd5b
Custom iterator for Ruleset
2020-11-27 20:53:34 +01:00
Ana Gelez
0e6d3f17c6
Seal the RulesetMember trait
...
+ use maplit instead of custom macro
+ fix two little issues in the documentation
2020-11-27 20:52:06 +01:00
Ana Gelez
1a29875fb4
Rename PushRule to SimplePushRule
2020-11-27 20:52:06 +01:00
Ana Gelez
5d988db5e7
impl Extend for Ruleset
2020-11-27 20:52:01 +01:00
Ana Gelez
0e0491c02b
Add a "add" method on Ruleset
...
- Add wrapper types for each kind of push rule
- Add a trait to add a push rule to a rule set
2020-11-27 20:50:10 +01:00
Ana Gelez
98082e0081
Implement IntoIterator for Ruleset
2020-11-27 20:46:58 +01:00
Ana Gelez
e8622ee809
Use a BTreeSet instead of a Vec to make push rule IDs unique
...
- Introduce a new macro to easily derive Ord, PartialOrd, Eq and PartialEq
for a PushRule-like type (these traits are required by BTreeSet)
- Introduce a new macro to easily build a BTreeSet
2020-11-27 20:46:58 +01:00
Gelez
4c41bfd1f3
Add constructors for default push rules
2020-11-24 22:37:09 +01:00
Jonas Platte
dd6446822b
Derive PartialEq and Eq for all string-wrapping enums
2020-11-02 00:29:47 +01:00
Jonas Platte
d34a270919
Allow custom values for more enums
2020-11-02 00:29:47 +01:00
Jonas Platte
eab5368edd
common: Make recently-moved types non-exhaustive
2020-09-11 21:13:04 +02:00
Devin Ragotzy
bedffcd45a
Move PusherData to ruma-common
2020-09-11 19:18:52 +02:00
Devin Ragotzy
a3ae741699
Add unstable-exhaustive-types flag to ruma-common
2020-09-03 20:55:11 +02:00
Jonas Platte
fbeae794c1
common: Make remaining fully public struct non-exhaustive
2020-08-19 01:38:23 +02:00
Jonas Platte
1fbf05d71f
Fix some bad formatting
2020-08-08 21:52:58 +02:00
Jonas Platte
324d339f06
ruma-common: Make most public types non-exhaustive
2020-07-24 20:55:59 +02:00
Jonas Platte
c89905283f
ruma-common: Move AnyPushRule into its own module
2020-07-24 20:40:51 +02:00
Jonas Platte
e04ed242fc
Split ruma_common::push into more submodules
2020-07-24 20:15:29 +02:00
Kinrany
9190bff1d0
Split AnyPushRuleConversionError in two and impl Error
2020-07-22 21:16:41 +02:00
Kinrany
4570fa2fef
Update AnyPushRule description
2020-07-22 21:16:41 +02:00
Kinrany
8eb96549d3
Implement From and TryFrom for AnyPushRule
...
Conversion into PushRule always succeeds, so no need to use TryFrom there
2020-07-22 21:16:41 +02:00
Kinrany
dca8e8c53e
Move PushRule from ruma_client_api to ruma_common
...
Moves ruma_client_api::r0::PushRule to ruma_common::push::AnyPushRule
2020-07-22 21:16:41 +02:00
Jonas Platte
8683901e14
Don't to_string() string literals
2020-07-14 22:11:05 +02:00
Kinrany
99999af08d
Create a dedicated type for PushCondition::RoomMemberCount::is
2020-06-21 21:20:43 +02:00
Jonas Platte
83d8f8c43e
Move some types from ruma_events::push_rules to ruma_common::push
2020-06-15 19:05:17 +02:00
Jonas Platte
8ddff0d108
Merge rustfmt settings, re-run cargo fmt
2020-06-05 02:01:09 +02:00
Jonas Platte
40b51d73a3
Add 'ruma-common/' from commit 'b516c0cd72c1a5e9985905f60b956c5365cd8789'
...
git-subtree-dir: ruma-common
git-subtree-mainline: c186f0f8c9c542fd1c7cea464de1ae94e5bd32ba
git-subtree-split: b516c0cd72c1a5e9985905f60b956c5365cd8789
2020-06-05 01:40:05 +02:00