events: Add missing ctor / From impl for EncryptedToDeviceEventContent
This commit is contained in:
parent
ea2ee79aa0
commit
6177bfccef
@ -1,5 +1,10 @@
|
||||
# [unreleased]
|
||||
|
||||
Improvements:
|
||||
|
||||
* Add missing constructor and `From` implementation for
|
||||
`EncryptedToDeviceEventContent`
|
||||
|
||||
# 0.24.1
|
||||
|
||||
Breaking changes:
|
||||
|
@ -60,6 +60,19 @@ pub struct EncryptedToDeviceEventContent {
|
||||
pub scheme: EncryptedEventScheme,
|
||||
}
|
||||
|
||||
impl EncryptedToDeviceEventContent {
|
||||
/// Creates a new `EncryptedToDeviceEventContent` with the given scheme.
|
||||
pub fn new(scheme: EncryptedEventScheme) -> Self {
|
||||
Self { scheme }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EncryptedEventScheme> for EncryptedToDeviceEventContent {
|
||||
fn from(scheme: EncryptedEventScheme) -> Self {
|
||||
Self { scheme }
|
||||
}
|
||||
}
|
||||
|
||||
/// The encryption scheme for `EncryptedEventContent`.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user