use axum::extract::FromRequestParts; use axum::http::request::Parts; use serde::de::DeserializeOwned; use super::error::ApiError; pub struct XrpcQuery(pub T); impl FromRequestParts for XrpcQuery { type Rejection = ApiError; async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result { let raw = parts.uri.query().unwrap_or_default(); serde_urlencoded::from_str(raw) .map(Self) .map_err(|e| ApiError::InvalidRequest(e.to_string())) } }