rig-core 0.44.0

An opinionated library for building LLM powered applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Missing and provided states for type-safe builders.
//!
//! ```
//! use rig_core::markers::Provided;
//!
//! let value = Provided("ready");
//! assert_eq!(value.0, "ready");
//! ```

use serde::{Deserialize, Serialize};

/// Marker struct representing missing data in a request builder.
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
pub struct Missing;

/// Builder state containing a supplied value of type `T`.
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
pub struct Provided<T>(pub T);