1//! Types for the [`m.policy.rule.server`] event.
2//!
3//! [`m.policy.rule.server`]: https://spec.matrix.org/latest/client-server-api/#mpolicyruleserver
45use ruma_macros::EventContent;
6use serde::{Deserialize, Serialize};
78use super::{PolicyRuleEventContent, PossiblyRedactedPolicyRuleEventContent};
9use crate::{EventContent, PossiblyRedactedStateEventContent, StateEventType};
1011/// The content of an `m.policy.rule.server` event.
12///
13/// This event type is used to apply rules to server entities.
14#[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);
1819/// The possibly redacted form of [`PolicyRuleServerEventContent`].
20///
21/// This type is used when it's not obvious whether the content is redacted or not.
22#[derive(Clone, Debug, Deserialize, Serialize)]
23#[allow(clippy::exhaustive_structs)]
24pub struct PossiblyRedactedPolicyRuleServerEventContent(pub PossiblyRedactedPolicyRuleEventContent);
2526impl EventContent for PossiblyRedactedPolicyRuleServerEventContent {
27type EventType = StateEventType;
2829fn event_type(&self) -> Self::EventType {
30 StateEventType::PolicyRuleServer
31 }
32}
3334impl PossiblyRedactedStateEventContent for PossiblyRedactedPolicyRuleServerEventContent {
35type StateKey = String;
36}