implement request making
This commit is contained in:
parent
840c0b95df
commit
5743585a77
6 changed files with 77 additions and 11 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue