ruma_events/policy/rule/
server.rs1use ruma_macros::EventContent;
6use serde::{Deserialize, Serialize};
7
8use super::{PolicyRuleEventContent, PossiblyRedactedPolicyRuleEventContent};
9use crate::{EventContent, PossiblyRedactedStateEventContent, StateEventType};
10
11#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
15#[allow(clippy::exhaustive_structs)]
16#[ruma_event(type = "m.policy.rule.server", kind = State, state_key_type = String, custom_possibly_redacted)]
17pub struct PolicyRuleServerEventContent(pub PolicyRuleEventContent);
18
19#[derive(Clone, Debug, Deserialize, Serialize)]
23#[allow(clippy::exhaustive_structs)]
24pub struct PossiblyRedactedPolicyRuleServerEventContent(pub PossiblyRedactedPolicyRuleEventContent);
25
26impl EventContent for PossiblyRedactedPolicyRuleServerEventContent {
27 type EventType = StateEventType;
28
29 fn event_type(&self) -> Self::EventType {
30 StateEventType::PolicyRuleServer
31 }
32}
33
34impl PossiblyRedactedStateEventContent for PossiblyRedactedPolicyRuleServerEventContent {
35 type StateKey = String;
36}