#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct Bold<'a> {}
fn lexicon_doc_fyi_questionable_richtext_facet() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("fyi.questionable.richtext.facet"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("bold"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for bold text",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("byteSlice"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("byteStart"),
::jacquard_common::deps::smol_str::SmolStr::new_static("byteEnd")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"byteEnd",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: Some(0i64),
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"byteStart",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: Some(0i64),
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("code"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for inline code.",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("highlight"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for highlighted text.",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("italic"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for italic text",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("link"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",
),
),
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: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Uri,
),
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("main"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Annotation of a sub-string within rich text.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("index"),
::jacquard_common::deps::smol_str::SmolStr::new_static("features")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"features",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#link"),
::jacquard_common::CowStr::new_static("#mention"),
::jacquard_common::CowStr::new_static("#code"),
::jacquard_common::CowStr::new_static("#highlight"),
::jacquard_common::CowStr::new_static("#underline"),
::jacquard_common::CowStr::new_static("#strikethrough"),
::jacquard_common::CowStr::new_static("#bold"),
::jacquard_common::CowStr::new_static("#italic")
],
closed: None,
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"index",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#byteSlice"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("mention"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for mentioning a did.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("did")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"did",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Did,
),
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("strikethrough"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for strikethrough markup",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("underline"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Facet feature for underline markup",
),
),
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Bold<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"bold"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 ByteSlice<'a> {
pub byte_end: i64,
pub byte_start: i64,
}
pub mod byte_slice_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 ByteEnd;
type ByteStart;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ByteEnd = Unset;
type ByteStart = Unset;
}
pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetByteEnd<S> {}
impl<S: State> State for SetByteEnd<S> {
type ByteEnd = Set<members::byte_end>;
type ByteStart = S::ByteStart;
}
pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetByteStart<S> {}
impl<S: State> State for SetByteStart<S> {
type ByteEnd = S::ByteEnd;
type ByteStart = Set<members::byte_start>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct byte_end(());
pub struct byte_start(());
}
}
pub struct ByteSliceBuilder<'a, S: byte_slice_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<i64>, ::core::option::Option<i64>),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ByteSlice<'a> {
pub fn new() -> ByteSliceBuilder<'a, byte_slice_state::Empty> {
ByteSliceBuilder::new()
}
}
impl<'a> ByteSliceBuilder<'a, byte_slice_state::Empty> {
pub fn new() -> Self {
ByteSliceBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ByteSliceBuilder<'a, S>
where
S: byte_slice_state::State,
S::ByteEnd: byte_slice_state::IsUnset,
{
pub fn byte_end(
mut self,
value: impl Into<i64>,
) -> ByteSliceBuilder<'a, byte_slice_state::SetByteEnd<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ByteSliceBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ByteSliceBuilder<'a, S>
where
S: byte_slice_state::State,
S::ByteStart: byte_slice_state::IsUnset,
{
pub fn byte_start(
mut self,
value: impl Into<i64>,
) -> ByteSliceBuilder<'a, byte_slice_state::SetByteStart<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ByteSliceBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ByteSliceBuilder<'a, S>
where
S: byte_slice_state::State,
S::ByteEnd: byte_slice_state::IsSet,
S::ByteStart: byte_slice_state::IsSet,
{
pub fn build(self) -> ByteSlice<'a> {
ByteSlice {
byte_end: self.__unsafe_private_named.0.unwrap(),
byte_start: 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>,
>,
) -> ByteSlice<'a> {
ByteSlice {
byte_end: self.__unsafe_private_named.0.unwrap(),
byte_start: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ByteSlice<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"byteSlice"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.byte_end;
if *value < 0i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"byte_end",
),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.byte_start;
if *value < 0i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"byte_start",
),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct Code<'a> {}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Code<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"code"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Highlight<'a> {}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Highlight<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"highlight"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Italic<'a> {}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Italic<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"italic"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Link<'a> {
#[serde(borrow)]
pub uri: jacquard_common::types::string::UriValue<'a>,
}
pub mod 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 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 LinkBuilder<'a, S: link_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::UriValue<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Link<'a> {
pub fn new() -> LinkBuilder<'a, link_state::Empty> {
LinkBuilder::new()
}
}
impl<'a> LinkBuilder<'a, link_state::Empty> {
pub fn new() -> Self {
LinkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LinkBuilder<'a, S>
where
S: link_state::State,
S::Uri: link_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::UriValue<'a>>,
) -> LinkBuilder<'a, link_state::SetUri<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
LinkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LinkBuilder<'a, S>
where
S: link_state::State,
S::Uri: link_state::IsSet,
{
pub fn build(self) -> Link<'a> {
Link {
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>,
>,
) -> Link<'a> {
Link {
uri: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Link<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"link"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Facet<'a> {
#[serde(borrow)]
pub features: Vec<FacetFeaturesItem<'a>>,
#[serde(borrow)]
pub index: crate::fyi_questionable::richtext::facet::ByteSlice<'a>,
}
pub mod facet_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 Features;
type Index;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Features = Unset;
type Index = Unset;
}
pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetFeatures<S> {}
impl<S: State> State for SetFeatures<S> {
type Features = Set<members::features>;
type Index = S::Index;
}
pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndex<S> {}
impl<S: State> State for SetIndex<S> {
type Features = S::Features;
type Index = Set<members::index>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct features(());
pub struct index(());
}
}
pub struct FacetBuilder<'a, S: facet_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<FacetFeaturesItem<'a>>>,
::core::option::Option<crate::fyi_questionable::richtext::facet::ByteSlice<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Facet<'a> {
pub fn new() -> FacetBuilder<'a, facet_state::Empty> {
FacetBuilder::new()
}
}
impl<'a> FacetBuilder<'a, facet_state::Empty> {
pub fn new() -> Self {
FacetBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FacetBuilder<'a, S>
where
S: facet_state::State,
S::Features: facet_state::IsUnset,
{
pub fn features(
mut self,
value: impl Into<Vec<FacetFeaturesItem<'a>>>,
) -> FacetBuilder<'a, facet_state::SetFeatures<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
FacetBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FacetBuilder<'a, S>
where
S: facet_state::State,
S::Index: facet_state::IsUnset,
{
pub fn index(
mut self,
value: impl Into<crate::fyi_questionable::richtext::facet::ByteSlice<'a>>,
) -> FacetBuilder<'a, facet_state::SetIndex<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
FacetBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FacetBuilder<'a, S>
where
S: facet_state::State,
S::Features: facet_state::IsSet,
S::Index: facet_state::IsSet,
{
pub fn build(self) -> Facet<'a> {
Facet {
features: self.__unsafe_private_named.0.unwrap(),
index: 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>,
>,
) -> Facet<'a> {
Facet {
features: self.__unsafe_private_named.0.unwrap(),
index: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
#[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 FacetFeaturesItem<'a> {
#[serde(rename = "fyi.questionable.richtext.facet#link")]
Link(Box<crate::fyi_questionable::richtext::facet::Link<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#mention")]
Mention(Box<crate::fyi_questionable::richtext::facet::Mention<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#code")]
Code(Box<crate::fyi_questionable::richtext::facet::Code<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#highlight")]
Highlight(Box<crate::fyi_questionable::richtext::facet::Highlight<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#underline")]
Underline(Box<crate::fyi_questionable::richtext::facet::Underline<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#strikethrough")]
Strikethrough(Box<crate::fyi_questionable::richtext::facet::Strikethrough<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#bold")]
Bold(Box<crate::fyi_questionable::richtext::facet::Bold<'a>>),
#[serde(rename = "fyi.questionable.richtext.facet#italic")]
Italic(Box<crate::fyi_questionable::richtext::facet::Italic<'a>>),
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Facet<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Mention<'a> {
#[serde(borrow)]
pub did: jacquard_common::types::string::Did<'a>,
}
pub mod mention_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 Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct MentionBuilder<'a, S: mention_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Did<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Mention<'a> {
pub fn new() -> MentionBuilder<'a, mention_state::Empty> {
MentionBuilder::new()
}
}
impl<'a> MentionBuilder<'a, mention_state::Empty> {
pub fn new() -> Self {
MentionBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> MentionBuilder<'a, S>
where
S: mention_state::State,
S::Did: mention_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> MentionBuilder<'a, mention_state::SetDid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
MentionBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> MentionBuilder<'a, S>
where
S: mention_state::State,
S::Did: mention_state::IsSet,
{
pub fn build(self) -> Mention<'a> {
Mention {
did: 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>,
>,
) -> Mention<'a> {
Mention {
did: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Mention<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"mention"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Strikethrough<'a> {}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Strikethrough<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"strikethrough"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
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 Underline<'a> {}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Underline<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.facet"
}
fn def_name() -> &'static str {
"underline"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_facet()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}