implement request making

This commit is contained in:
Aleksandr 2025-10-06 01:36:36 +03:00
parent 840c0b95df
commit 5743585a77
6 changed files with 77 additions and 11 deletions

View file

@ -2,7 +2,7 @@ use axum::{
http::StatusCode,
response::{IntoResponse, Response as AxumResponse},
};
use serde::Serialize;
use serde::{Serialize, Deserialize};
use crate::format::{DumpParams, Format};
use crate::requests::{IsResponse, status_code::HasStatusCode};
@ -18,7 +18,7 @@ macro_rules! header {
#[track_caller]
pub fn err<E: IsResponse>(format: Format, error: E) -> AxumResponse {
#[derive(Serialize)]
#[derive(Serialize, Deserialize)]
struct Failure<E> {
pub error: E,
}
@ -34,7 +34,7 @@ pub fn err<E: IsResponse>(format: Format, error: E) -> AxumResponse {
#[track_caller]
pub fn ok<O: IsResponse>(format: Format, ok: O) -> AxumResponse {
#[derive(Serialize)]
#[derive(Serialize, Deserialize)]
struct Success<T> {
ok: T,
}