use crate::Error; use ruma::{ api::client::uiaa::UiaaResponse, identifiers::{DeviceId, UserId}, signatures::CanonicalJsonValue, Outgoing, ServerName, }; use std::ops::Deref; #[cfg(feature = "conduit_bin")] mod axum; /// Extractor for Ruma request structs pub struct Ruma { pub body: T::Incoming, pub sender_user: Option>, pub sender_device: Option>, pub sender_servername: Option>, // This is None when body is not a valid string pub json_body: Option, pub from_appservice: bool, } impl Deref for Ruma { type Target = T::Incoming; fn deref(&self) -> &Self::Target { &self.body } } #[derive(Clone)] pub struct RumaResponse(pub T); impl From for RumaResponse { fn from(t: T) -> Self { Self(t) } } impl From for RumaResponse { fn from(t: Error) -> Self { t.to_response() } }