rename RumaResponse to Ra

It's very commonly used so having a short name is worthwhile, I think.
This commit is contained in:
Charles Hall 2024-05-18 18:59:46 -07:00
parent 230ebd3884
commit 7ea98dac72
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
38 changed files with 332 additions and 351 deletions

View file

@ -28,16 +28,20 @@ impl<T> Deref for Ruma<T> {
}
}
/// A wrapper to convert Ruma data to an Axum response
///
/// Named so because this converts from **R**uma to **A**xum. See also [`Ruma`],
/// which is roughly the inverse of this type.
#[derive(Clone)]
pub(crate) struct RumaResponse<T>(pub(crate) T);
pub(crate) struct Ra<T>(pub(crate) T);
impl<T> From<T> for RumaResponse<T> {
impl<T> From<T> for Ra<T> {
fn from(t: T) -> Self {
Self(t)
}
}
impl From<Error> for RumaResponse<UiaaResponse> {
impl From<Error> for Ra<UiaaResponse> {
fn from(t: Error) -> Self {
t.to_response()
}