paperless_rs/utils/
mod.rs

1use serde::{Deserialize, Serialize};
2
3pub mod pagination;
4
5/// This macro allows you to use a ternary operator in Rust.
6#[macro_export]
7macro_rules! ternary {
8    ($condition: expr, $_true: expr, $_false: expr) => {
9        if $condition {
10            $_true
11        } else {
12            $_false
13        }
14    };
15}
16
17/// A simple struct that represents a field in a document.
18#[derive(Serialize, Deserialize, Clone, Debug)]
19pub struct Field {
20    pub field: String,
21    pub value: String,
22}