Skip to main content

jacquard_api/
builder_types.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// This file was automatically generated from Lexicon schemas.
4// Any manual changes will be overwritten on the next regeneration.
5
6/// Marker type indicating a builder field has been set
7pub struct Set<T>(pub T);
8impl<T> Set<T> {
9    /// Extract the inner value
10    #[inline]
11    pub fn into_inner(self) -> T {
12        self.0
13    }
14}
15
16/// Marker type indicating a builder field has not been set
17pub struct Unset;
18/// Trait indicating a builder field is set (has a value)
19
20#[jacquard_common::deps::codegen::rustversion::attr(
21    since(1.78.0),
22    diagnostic::on_unimplemented(
23        message = "the field `{Self}` was not set, but this method requires it to be set",
24        label = "the field `{Self}` was not set"
25    )
26)]
27pub trait IsSet: private::Sealed {}
28/// Trait indicating a builder field is unset (no value yet)
29
30#[jacquard_common::deps::codegen::rustversion::attr(
31    since(1.78.0),
32    diagnostic::on_unimplemented(
33        message = "the field `{Self}` was already set, but this method requires it to be unset",
34        label = "the field `{Self}` was already set"
35    )
36)]
37pub trait IsUnset: private::Sealed {}
38impl<T> IsSet for Set<T> {}
39impl IsUnset for Unset {}
40mod private {
41    /// Sealed trait to prevent external implementations
42    pub trait Sealed {}
43    impl<T> Sealed for super::Set<T> {}
44    impl Sealed for super::Unset {}
45}