pub mod binding;
pub mod component;
pub mod fragment;
pub mod loading;
pub mod maybe;
pub mod missing;
pub mod pack;
pub mod placeholder;
pub mod slot;
pub mod throw;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct CachePolicy<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub life: std::option::Option<CachePolicyLife<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<Vec<CachePolicyTagsItem<'a>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CachePolicyLife<'a> {
Seconds,
Minutes,
Hours,
Max,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> CachePolicyLife<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Seconds => "seconds",
Self::Minutes => "minutes",
Self::Hours => "hours",
Self::Max => "max",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for CachePolicyLife<'a> {
fn from(s: &'a str) -> Self {
match s {
"seconds" => Self::Seconds,
"minutes" => Self::Minutes,
"hours" => Self::Hours,
"max" => Self::Max,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for CachePolicyLife<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"seconds" => Self::Seconds,
"minutes" => Self::Minutes,
"hours" => Self::Hours,
"max" => Self::Max,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for CachePolicyLife<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for CachePolicyLife<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for CachePolicyLife<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for CachePolicyLife<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for CachePolicyLife<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for CachePolicyLife<'_> {
type Output = CachePolicyLife<'static>;
fn into_static(self) -> Self::Output {
match self {
CachePolicyLife::Seconds => CachePolicyLife::Seconds,
CachePolicyLife::Minutes => CachePolicyLife::Minutes,
CachePolicyLife::Hours => CachePolicyLife::Hours,
CachePolicyLife::Max => CachePolicyLife::Max,
CachePolicyLife::Other(v) => CachePolicyLife::Other(v.into_static()),
}
}
}
#[jacquard_derive::open_union]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum CachePolicyTagsItem<'a> {
#[serde(rename = "at.inlay.defs#tagRecord")]
TagRecord(Box<crate::at_inlay::TagRecord<'a>>),
#[serde(rename = "at.inlay.defs#tagLink")]
TagLink(Box<crate::at_inlay::TagLink<'a>>),
}
fn lexicon_doc_at_inlay_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("at.inlay.defs"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("cachePolicy"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Cache lifetime and invalidation tags returned by XRPC components.",
),
),
required: None,
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"life",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"How frequently the underlying data changes",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(32usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Data dependencies for cache invalidation",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#tagRecord"),
::jacquard_common::CowStr::new_static("#tagLink")
],
closed: None,
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("element"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A renderable Inlay element.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("type")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"key",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Stable key that identifies the component among its siblings.",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(256usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"props",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"type",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"NSID of the component to render.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Nsid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("response"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Standard response from a component render call.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("node"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cache")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cache",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#cachePolicy"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"node",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#element"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("tagLink"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Cache tag: depend on backlink relationships to a subject.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("subject")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"from",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Collection NSID of the linking records. Omit for any collection.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Nsid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"subject",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Subject AT URI that is linked to",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("tagRecord"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Cache tag: depend on a specific record, collection, or identity.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT URI at record, collection, or identity granularity",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("viaValtown"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("valId")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"valId",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Val Town val UUID"),
),
format: None,
default: None,
min_length: None,
max_length: Some(128usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CachePolicy<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"cachePolicy"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.life {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 32usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"life",
),
max: 32usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Element<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub key: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub props: std::option::Option<jacquard_common::types::value::Data<'a>>,
#[serde(borrow)]
pub r#type: jacquard_common::types::string::Nsid<'a>,
}
pub mod element_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Type = Unset;
}
pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetType<S> {}
impl<S: State> State for SetType<S> {
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#type(());
}
}
pub struct ElementBuilder<'a, S: element_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<jacquard_common::types::string::Nsid<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Element<'a> {
pub fn new() -> ElementBuilder<'a, element_state::Empty> {
ElementBuilder::new()
}
}
impl<'a> ElementBuilder<'a, element_state::Empty> {
pub fn new() -> Self {
ElementBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: element_state::State> ElementBuilder<'a, S> {
pub fn key(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_key(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: element_state::State> ElementBuilder<'a, S> {
pub fn props(
mut self,
value: impl Into<Option<jacquard_common::types::value::Data<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_props(
mut self,
value: Option<jacquard_common::types::value::Data<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> ElementBuilder<'a, S>
where
S: element_state::State,
S::Type: element_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<jacquard_common::types::string::Nsid<'a>>,
) -> ElementBuilder<'a, element_state::SetType<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
ElementBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ElementBuilder<'a, S>
where
S: element_state::State,
S::Type: element_state::IsSet,
{
pub fn build(self) -> Element<'a> {
Element {
key: self.__unsafe_private_named.0,
props: self.__unsafe_private_named.1,
r#type: self.__unsafe_private_named.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Element<'a> {
Element {
key: self.__unsafe_private_named.0,
props: self.__unsafe_private_named.1,
r#type: self.__unsafe_private_named.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Element<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"element"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.key {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 256usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"key",
),
max: 256usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Response<'a> {
#[serde(borrow)]
pub cache: crate::at_inlay::CachePolicy<'a>,
#[serde(borrow)]
pub node: crate::at_inlay::Element<'a>,
}
pub mod response_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Node;
type Cache;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Node = Unset;
type Cache = Unset;
}
pub struct SetNode<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNode<S> {}
impl<S: State> State for SetNode<S> {
type Node = Set<members::node>;
type Cache = S::Cache;
}
pub struct SetCache<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCache<S> {}
impl<S: State> State for SetCache<S> {
type Node = S::Node;
type Cache = Set<members::cache>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct node(());
pub struct cache(());
}
}
pub struct ResponseBuilder<'a, S: response_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::at_inlay::CachePolicy<'a>>,
::core::option::Option<crate::at_inlay::Element<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Response<'a> {
pub fn new() -> ResponseBuilder<'a, response_state::Empty> {
ResponseBuilder::new()
}
}
impl<'a> ResponseBuilder<'a, response_state::Empty> {
pub fn new() -> Self {
ResponseBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ResponseBuilder<'a, S>
where
S: response_state::State,
S::Cache: response_state::IsUnset,
{
pub fn cache(
mut self,
value: impl Into<crate::at_inlay::CachePolicy<'a>>,
) -> ResponseBuilder<'a, response_state::SetCache<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ResponseBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ResponseBuilder<'a, S>
where
S: response_state::State,
S::Node: response_state::IsUnset,
{
pub fn node(
mut self,
value: impl Into<crate::at_inlay::Element<'a>>,
) -> ResponseBuilder<'a, response_state::SetNode<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ResponseBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ResponseBuilder<'a, S>
where
S: response_state::State,
S::Node: response_state::IsSet,
S::Cache: response_state::IsSet,
{
pub fn build(self) -> Response<'a> {
Response {
cache: self.__unsafe_private_named.0.unwrap(),
node: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Response<'a> {
Response {
cache: self.__unsafe_private_named.0.unwrap(),
node: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Response<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"response"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TagLink<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub from: std::option::Option<jacquard_common::types::string::Nsid<'a>>,
#[serde(borrow)]
pub subject: jacquard_common::types::string::AtUri<'a>,
}
pub mod tag_link_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Subject;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Subject = Unset;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type Subject = Set<members::subject>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct subject(());
}
}
pub struct TagLinkBuilder<'a, S: tag_link_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Nsid<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TagLink<'a> {
pub fn new() -> TagLinkBuilder<'a, tag_link_state::Empty> {
TagLinkBuilder::new()
}
}
impl<'a> TagLinkBuilder<'a, tag_link_state::Empty> {
pub fn new() -> Self {
TagLinkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: tag_link_state::State> TagLinkBuilder<'a, S> {
pub fn from(
mut self,
value: impl Into<Option<jacquard_common::types::string::Nsid<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_from(
mut self,
value: Option<jacquard_common::types::string::Nsid<'a>>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> TagLinkBuilder<'a, S>
where
S: tag_link_state::State,
S::Subject: tag_link_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> TagLinkBuilder<'a, tag_link_state::SetSubject<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
TagLinkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TagLinkBuilder<'a, S>
where
S: tag_link_state::State,
S::Subject: tag_link_state::IsSet,
{
pub fn build(self) -> TagLink<'a> {
TagLink {
from: self.__unsafe_private_named.0,
subject: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TagLink<'a> {
TagLink {
from: self.__unsafe_private_named.0,
subject: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TagLink<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"tagLink"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TagRecord<'a> {
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod tag_record_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct TagRecordBuilder<'a, S: tag_record_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TagRecord<'a> {
pub fn new() -> TagRecordBuilder<'a, tag_record_state::Empty> {
TagRecordBuilder::new()
}
}
impl<'a> TagRecordBuilder<'a, tag_record_state::Empty> {
pub fn new() -> Self {
TagRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TagRecordBuilder<'a, S>
where
S: tag_record_state::State,
S::Uri: tag_record_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> TagRecordBuilder<'a, tag_record_state::SetUri<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
TagRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TagRecordBuilder<'a, S>
where
S: tag_record_state::State,
S::Uri: tag_record_state::IsSet,
{
pub fn build(self) -> TagRecord<'a> {
TagRecord {
uri: self.__unsafe_private_named.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TagRecord<'a> {
TagRecord {
uri: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TagRecord<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"tagRecord"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct ViaValtown<'a> {
#[serde(borrow)]
pub val_id: jacquard_common::CowStr<'a>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViaValtown<'a> {
fn nsid() -> &'static str {
"at.inlay.defs"
}
fn def_name() -> &'static str {
"viaValtown"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_at_inlay_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.val_id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 128usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"val_id",
),
max: 128usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}