rapid_web/types.rs
1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize)]
4/// A union type that is used as a simple target for the Rapid compiler to generate typescript types for route handlers
5///
6/// # Example
7/// ```
8/// use rapid_web::types::Union;
9///
10/// type RapidOutput = Union<String, ErrorJsonBody>;
11/// ```
12pub struct Union<O, E> {
13 pub output: O,
14 pub error: E,
15}