Files
continuwuity/src/api/ruma_wrapper/mod.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
681 B
Rust
Raw Normal View History

2024-05-09 15:59:08 -07:00
pub(crate) mod axum;
mod xmatrix;
2024-05-09 15:59:08 -07:00
use std::ops::Deref;
2024-03-05 19:48:54 -05:00
2024-05-09 15:59:08 -07:00
use ruma::{CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId};
2024-03-05 19:48:54 -05:00
2024-05-09 15:59:08 -07:00
use crate::service::appservice::RegistrationInfo;
2020-02-15 22:42:21 +01:00
2022-01-20 11:51:31 +01:00
/// Extractor for Ruma request structs
2024-04-22 23:48:57 -04:00
pub(crate) struct Ruma<T> {
pub(crate) body: T,
pub(crate) sender_user: Option<OwnedUserId>,
pub(crate) sender_device: Option<OwnedDeviceId>,
pub(crate) sender_servername: Option<OwnedServerName>,
pub(crate) json_body: Option<CanonicalJsonValue>, // This is None when body is not a valid string
pub(crate) appservice_info: Option<RegistrationInfo>,
2020-03-28 18:50:02 +01:00
}
2020-03-28 23:08:59 +01:00
2022-04-06 21:31:29 +02:00
impl<T> Deref for Ruma<T> {
type Target = T;
2020-02-15 22:42:21 +01:00
fn deref(&self) -> &Self::Target { &self.body }
2020-03-28 18:50:02 +01:00
}