mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-28 10:48:30 +00:00
30 lines
822 B
Rust
30 lines
822 B
Rust
mod auth;
|
|
mod request;
|
|
mod router;
|
|
mod xmatrix;
|
|
|
|
use std::ops::Deref;
|
|
|
|
pub(super) use conduit::error::RumaResponse;
|
|
use ruma::{CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId};
|
|
|
|
pub(super) use self::router::RouterExt;
|
|
use crate::service::appservice::RegistrationInfo;
|
|
|
|
/// Extractor for Ruma request structs
|
|
pub(crate) struct Ruma<T> {
|
|
/// Request struct body
|
|
pub(crate) body: T,
|
|
pub(crate) sender_user: Option<OwnedUserId>,
|
|
pub(crate) sender_device: Option<OwnedDeviceId>,
|
|
/// X-Matrix origin/server
|
|
pub(crate) origin: Option<OwnedServerName>,
|
|
pub(crate) json_body: Option<CanonicalJsonValue>, // This is None when body is not a valid string
|
|
pub(crate) appservice_info: Option<RegistrationInfo>,
|
|
}
|
|
|
|
impl<T> Deref for Ruma<T> {
|
|
type Target = T;
|
|
|
|
fn deref(&self) -> &Self::Target { &self.body }
|
|
}
|