Skip to main content

rig_core/
markers.rs

1//! Missing and provided states for type-safe builders.
2//!
3//! ```
4//! use rig_core::markers::Provided;
5//!
6//! let value = Provided("ready");
7//! assert_eq!(value.0, "ready");
8//! ```
9
10use serde::{Deserialize, Serialize};
11
12/// Marker struct representing missing data in a request builder.
13#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
14pub struct Missing;
15
16/// Builder state containing a supplied value of type `T`.
17#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
18pub struct Provided<T>(pub T);