events: Add constructor for EncryptedEventContent

This commit is contained in:
Kévin Commaille 2021-05-07 11:34:10 +02:00 committed by GitHub
parent b96ab9580e
commit db76c22180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,13 @@ pub struct EncryptedEventContent {
pub relates_to: Option<Relation>,
}
impl EncryptedEventContent {
/// Creates a new `EncryptedEventContent` with the given scheme and relation.
pub fn new(scheme: EncryptedEventScheme, relates_to: Option<Relation>) -> Self {
Self { scheme, relates_to }
}
}
/// The to-device version of the payload for the `EncryptedEvent`.
pub type EncryptedToDeviceEventContent = EncryptedEventContent;