use crate::Error; use ruma::{ api::client::uiaa::UiaaResponse, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, }; use std::ops::Deref; #[cfg(feature = "conduit_bin")] mod axum; /// Extractor for Ruma request structs pub struct Ruma { pub body: T, 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; 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() } }