pub mod authors;
pub mod book;
pub mod chapter;
pub mod colour_scheme;
pub mod entry;
pub mod get_book_entry;
pub mod get_chapter;
pub mod get_continue_reading;
pub mod get_entry;
pub mod get_entry_by_title;
pub mod get_entry_detail;
pub mod get_entry_feed;
pub mod get_entry_notebooks;
pub mod get_notebook;
pub mod get_notebook_by_title;
pub mod get_notebook_chapters;
pub mod get_notebook_detail;
pub mod get_notebook_feed;
pub mod get_page;
pub mod get_published_versions;
pub mod get_reading_history;
pub mod get_similar_notebooks;
pub mod get_suggested_notebooks;
pub mod page;
pub mod resolve_entry;
pub mod resolve_notebook;
pub mod resolve_version_conflict;
pub mod search_entries;
pub mod search_notebooks;
pub mod theme;
pub mod update_reading_progress;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct AuthorListView<'a> {
pub index: i64,
#[serde(borrow)]
pub record: crate::sh_weaver::actor::ProfileDataView<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
}
pub mod author_list_view_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 Index;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Index = Unset;
type Record = Unset;
}
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 Index = Set<members::index>;
type Record = S::Record;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Index = S::Index;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct index(());
pub struct record(());
}
}
pub struct AuthorListViewBuilder<'a, S: author_list_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::actor::ProfileDataView<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> AuthorListView<'a> {
pub fn new() -> AuthorListViewBuilder<'a, author_list_view_state::Empty> {
AuthorListViewBuilder::new()
}
}
impl<'a> AuthorListViewBuilder<'a, author_list_view_state::Empty> {
pub fn new() -> Self {
AuthorListViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AuthorListViewBuilder<'a, S>
where
S: author_list_view_state::State,
S::Index: author_list_view_state::IsUnset,
{
pub fn index(
mut self,
value: impl Into<i64>,
) -> AuthorListViewBuilder<'a, author_list_view_state::SetIndex<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
AuthorListViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AuthorListViewBuilder<'a, S>
where
S: author_list_view_state::State,
S::Record: author_list_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileDataView<'a>>,
) -> AuthorListViewBuilder<'a, author_list_view_state::SetRecord<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
AuthorListViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> {
pub fn uri(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_uri(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> AuthorListViewBuilder<'a, S>
where
S: author_list_view_state::State,
S::Index: author_list_view_state::IsSet,
S::Record: author_list_view_state::IsSet,
{
pub fn build(self) -> AuthorListView<'a> {
AuthorListView {
index: self.__unsafe_private_named.0.unwrap(),
record: self.__unsafe_private_named.1.unwrap(),
uri: self.__unsafe_private_named.2,
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>,
>,
) -> AuthorListView<'a> {
AuthorListView {
index: self.__unsafe_private_named.0.unwrap(),
record: self.__unsafe_private_named.1.unwrap(),
uri: self.__unsafe_private_named.2,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("authorListView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("index")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"index",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"sh.weaver.actor.defs#profileDataView",
),
}),
);
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::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("bookEntryRef"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("entry")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"entry",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("bookEntryView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"An ordered entry in a Weaver notebook.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("entry"),
::jacquard_common::deps::smol_str::SmolStr::new_static("index")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"entry",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"index",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"next",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#bookEntryRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"prev",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#bookEntryRef",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"chapterEntryView",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"An entry within a chapter context.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("entry"),
::jacquard_common::deps::smol_str::SmolStr::new_static("index")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"entry",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"index",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"next",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#bookEntryRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"prev",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#bookEntryRef",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("chapterView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Hydrated view of a chapter.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("notebook"),
::jacquard_common::deps::smol_str::SmolStr::new_static("authors"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"authors",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#authorListView",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"entryCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"notebook",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#notebookView",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#tags"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#title"),
}),
);
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::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("contentFormat"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"The format of the content. This is used to determine how to render the content.",
),
),
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(
"markdown",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The format of the content. This is used to determine how to render the content.",
),
),
format: None,
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("contentRating"),
::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Author-applied content rating.",
),
),
format: None,
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("contentWarning"),
::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Author-applied content warning.",
),
),
format: None,
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(
"contentWarnings",
),
::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#contentWarning"),
}),
min_length: None,
max_length: Some(10usize),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("entryView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("authors"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"authors",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#authorListView",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"bookmarkCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"likeCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"path",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#path"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"permissions",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#permissionsState",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"renderedView",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#renderedView",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#tags"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#title"),
}),
);
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::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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerBookmark",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerLike",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerReadingProgress",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#readingProgress",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("feedEntryView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Entry with feed-specific context (discovery reason, notebook context).",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("entry")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"entry",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"notebookContext",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#feedNotebookContext",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"reason",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#feedReason"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"feedNotebookContext",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Minimal notebook context for feed display.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("title")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"path",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
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(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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("feedReason"),
::jacquard_lexicon::lexicon::LexUserType::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#reasonLike"),
::jacquard_common::CowStr::new_static("#reasonBookmark"),
::jacquard_common::CowStr::new_static("#reasonSubscription")
],
closed: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("notebookView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("authors"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"authors",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#authorListView",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"bookmarkCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"entryCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"likeCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"path",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#path"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"permissions",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#permissionsState",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"subscriberCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#tags"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#title"),
}),
);
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::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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerBookmark",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerLike",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerReadingProgress",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#readingProgress",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerSubscription",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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("pageView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Hydrated view of a page (entries displayed together).",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("notebook"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"entryCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"notebook",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#notebookView",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#tags"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#title"),
}),
);
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::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("path"),
::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The path of the notebook.",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(100usize),
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(
"permissionGrant",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("did"),
::jacquard_common::deps::smol_str::SmolStr::new_static("scope"),
::jacquard_common::deps::smol_str::SmolStr::new_static("source"),
::jacquard_common::deps::smol_str::SmolStr::new_static("grantedAt")
],
),
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"grantedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"For authority: record createdAt. For invitees: accept createdAt",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"scope",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"direct = this resource (includes authority), inherited = via notebook invite",
),
),
format: None,
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(
"source",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"For authority: resource URI. For invitees: invite URI",
),
),
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(
"permissionsState",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"ACL-style permissions for a resource. Separate from authors (who contributed).",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("editors")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"editors",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"DIDs that can edit this resource",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#permissionGrant",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewers",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"DIDs that can view (future use)",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#permissionGrant",
),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"publishedVersionView",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A published version of an entry in a collaborator's repo.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("publisher"),
::jacquard_common::deps::smol_str::SmolStr::new_static("publishedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"divergedFrom",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.repo.strongRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"isCanonical",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"publishedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"publisher",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"sh.weaver.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"updatedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"readingProgress",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Viewer's reading progress (appview-side state, not a record).",
),
),
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(
"currentEntry",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Last entry the viewer was reading.",
),
),
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"finishedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"lastReadAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"percentComplete",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: Some(0i64),
maximum: Some(100i64),
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"startedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"status",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
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("reasonBookmark"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("by"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("by"),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"sh.weaver.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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("reasonLike"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("by"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("by"),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"sh.weaver.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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(
"reasonSubscription",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
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("renderedView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"View of a rendered and cached notebook entry",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("html")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"css",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
description: None,
accept: None,
max_size: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"html",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
description: None,
accept: None,
max_size: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("tags"),
::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: Some(64usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: Some(10usize),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("title"),
::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The title of the notebook entry.",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(300usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"authorListView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 BookEntryRef<'a> {
#[serde(borrow)]
pub entry: crate::sh_weaver::notebook::EntryView<'a>,
}
pub mod book_entry_ref_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 Entry;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Entry = Unset;
}
pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEntry<S> {}
impl<S: State> State for SetEntry<S> {
type Entry = Set<members::entry>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct entry(());
}
}
pub struct BookEntryRefBuilder<'a, S: book_entry_ref_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> BookEntryRef<'a> {
pub fn new() -> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> {
BookEntryRefBuilder::new()
}
}
impl<'a> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> {
pub fn new() -> Self {
BookEntryRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BookEntryRefBuilder<'a, S>
where
S: book_entry_ref_state::State,
S::Entry: book_entry_ref_state::IsUnset,
{
pub fn entry(
mut self,
value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
) -> BookEntryRefBuilder<'a, book_entry_ref_state::SetEntry<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
BookEntryRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BookEntryRefBuilder<'a, S>
where
S: book_entry_ref_state::State,
S::Entry: book_entry_ref_state::IsSet,
{
pub fn build(self) -> BookEntryRef<'a> {
BookEntryRef {
entry: 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>,
>,
) -> BookEntryRef<'a> {
BookEntryRef {
entry: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"bookEntryRef"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 BookEntryView<'a> {
#[serde(borrow)]
pub entry: crate::sh_weaver::notebook::EntryView<'a>,
pub index: i64,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub next: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub prev: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
}
pub mod book_entry_view_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 Entry;
type Index;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Entry = Unset;
type Index = Unset;
}
pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEntry<S> {}
impl<S: State> State for SetEntry<S> {
type Entry = Set<members::entry>;
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 Entry = S::Entry;
type Index = Set<members::index>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct entry(());
pub struct index(());
}
}
pub struct BookEntryViewBuilder<'a, S: book_entry_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> BookEntryView<'a> {
pub fn new() -> BookEntryViewBuilder<'a, book_entry_view_state::Empty> {
BookEntryViewBuilder::new()
}
}
impl<'a> BookEntryViewBuilder<'a, book_entry_view_state::Empty> {
pub fn new() -> Self {
BookEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BookEntryViewBuilder<'a, S>
where
S: book_entry_view_state::State,
S::Entry: book_entry_view_state::IsUnset,
{
pub fn entry(
mut self,
value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
) -> BookEntryViewBuilder<'a, book_entry_view_state::SetEntry<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
BookEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BookEntryViewBuilder<'a, S>
where
S: book_entry_view_state::State,
S::Index: book_entry_view_state::IsUnset,
{
pub fn index(
mut self,
value: impl Into<i64>,
) -> BookEntryViewBuilder<'a, book_entry_view_state::SetIndex<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
BookEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> {
pub fn next(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_next(
mut self,
value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> {
pub fn prev(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_prev(
mut self,
value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> BookEntryViewBuilder<'a, S>
where
S: book_entry_view_state::State,
S::Entry: book_entry_view_state::IsSet,
S::Index: book_entry_view_state::IsSet,
{
pub fn build(self) -> BookEntryView<'a> {
BookEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
index: self.__unsafe_private_named.1.unwrap(),
next: self.__unsafe_private_named.2,
prev: self.__unsafe_private_named.3,
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>,
>,
) -> BookEntryView<'a> {
BookEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
index: self.__unsafe_private_named.1.unwrap(),
next: self.__unsafe_private_named.2,
prev: self.__unsafe_private_named.3,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"bookEntryView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ChapterEntryView<'a> {
#[serde(borrow)]
pub entry: crate::sh_weaver::notebook::EntryView<'a>,
pub index: i64,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub next: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub prev: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
}
pub mod chapter_entry_view_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 Entry;
type Index;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Entry = Unset;
type Index = Unset;
}
pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEntry<S> {}
impl<S: State> State for SetEntry<S> {
type Entry = Set<members::entry>;
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 Entry = S::Entry;
type Index = Set<members::index>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct entry(());
pub struct index(());
}
}
pub struct ChapterEntryViewBuilder<'a, S: chapter_entry_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ChapterEntryView<'a> {
pub fn new() -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> {
ChapterEntryViewBuilder::new()
}
}
impl<'a> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> {
pub fn new() -> Self {
ChapterEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterEntryViewBuilder<'a, S>
where
S: chapter_entry_view_state::State,
S::Entry: chapter_entry_view_state::IsUnset,
{
pub fn entry(
mut self,
value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetEntry<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ChapterEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterEntryViewBuilder<'a, S>
where
S: chapter_entry_view_state::State,
S::Index: chapter_entry_view_state::IsUnset,
{
pub fn index(
mut self,
value: impl Into<i64>,
) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetIndex<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ChapterEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> {
pub fn next(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_next(
mut self,
value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> {
pub fn prev(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_prev(
mut self,
value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> ChapterEntryViewBuilder<'a, S>
where
S: chapter_entry_view_state::State,
S::Entry: chapter_entry_view_state::IsSet,
S::Index: chapter_entry_view_state::IsSet,
{
pub fn build(self) -> ChapterEntryView<'a> {
ChapterEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
index: self.__unsafe_private_named.1.unwrap(),
next: self.__unsafe_private_named.2,
prev: self.__unsafe_private_named.3,
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>,
>,
) -> ChapterEntryView<'a> {
ChapterEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
index: self.__unsafe_private_named.1.unwrap(),
next: self.__unsafe_private_named.2,
prev: self.__unsafe_private_named.3,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterEntryView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"chapterEntryView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ChapterView<'a> {
#[serde(borrow)]
pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub entry_count: std::option::Option<i64>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub notebook: crate::sh_weaver::notebook::NotebookView<'a>,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod chapter_view_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 IndexedAt;
type Authors;
type Cid;
type Uri;
type Notebook;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type Authors = Unset;
type Cid = Unset;
type Uri = Unset;
type Notebook = Unset;
type Record = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
type Authors = S::Authors;
type Cid = S::Cid;
type Uri = S::Uri;
type Notebook = S::Notebook;
type Record = S::Record;
}
pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthors<S> {}
impl<S: State> State for SetAuthors<S> {
type IndexedAt = S::IndexedAt;
type Authors = Set<members::authors>;
type Cid = S::Cid;
type Uri = S::Uri;
type Notebook = S::Notebook;
type Record = S::Record;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type IndexedAt = S::IndexedAt;
type Authors = S::Authors;
type Cid = Set<members::cid>;
type Uri = S::Uri;
type Notebook = S::Notebook;
type Record = S::Record;
}
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 IndexedAt = S::IndexedAt;
type Authors = S::Authors;
type Cid = S::Cid;
type Uri = Set<members::uri>;
type Notebook = S::Notebook;
type Record = S::Record;
}
pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNotebook<S> {}
impl<S: State> State for SetNotebook<S> {
type IndexedAt = S::IndexedAt;
type Authors = S::Authors;
type Cid = S::Cid;
type Uri = S::Uri;
type Notebook = Set<members::notebook>;
type Record = S::Record;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type IndexedAt = S::IndexedAt;
type Authors = S::Authors;
type Cid = S::Cid;
type Uri = S::Uri;
type Notebook = S::Notebook;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct authors(());
pub struct cid(());
pub struct uri(());
pub struct notebook(());
pub struct record(());
}
}
pub struct ChapterViewBuilder<'a, S: chapter_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::sh_weaver::notebook::NotebookView<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ChapterView<'a> {
pub fn new() -> ChapterViewBuilder<'a, chapter_view_state::Empty> {
ChapterViewBuilder::new()
}
}
impl<'a> ChapterViewBuilder<'a, chapter_view_state::Empty> {
pub fn new() -> Self {
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::Authors: chapter_view_state::IsUnset,
{
pub fn authors(
mut self,
value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetAuthors<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::Cid: chapter_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> {
pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::IndexedAt: chapter_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::Notebook: chapter_view_state::IsUnset,
{
pub fn notebook(
mut self,
value: impl Into<crate::sh_weaver::notebook::NotebookView<'a>>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetNotebook<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::Record: chapter_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetRecord<S>> {
self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<crate::sh_weaver::notebook::Tags<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> {
pub fn title(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_title(
mut self,
value: Option<crate::sh_weaver::notebook::Title<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::Uri: chapter_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ChapterViewBuilder<'a, chapter_view_state::SetUri<S>> {
self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into());
ChapterViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ChapterViewBuilder<'a, S>
where
S: chapter_view_state::State,
S::IndexedAt: chapter_view_state::IsSet,
S::Authors: chapter_view_state::IsSet,
S::Cid: chapter_view_state::IsSet,
S::Uri: chapter_view_state::IsSet,
S::Notebook: chapter_view_state::IsSet,
S::Record: chapter_view_state::IsSet,
{
pub fn build(self) -> ChapterView<'a> {
ChapterView {
authors: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
entry_count: self.__unsafe_private_named.2,
indexed_at: self.__unsafe_private_named.3.unwrap(),
notebook: self.__unsafe_private_named.4.unwrap(),
record: self.__unsafe_private_named.5.unwrap(),
tags: self.__unsafe_private_named.6,
title: self.__unsafe_private_named.7,
uri: self.__unsafe_private_named.8.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>,
>,
) -> ChapterView<'a> {
ChapterView {
authors: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
entry_count: self.__unsafe_private_named.2,
indexed_at: self.__unsafe_private_named.3.unwrap(),
notebook: self.__unsafe_private_named.4.unwrap(),
record: self.__unsafe_private_named.5.unwrap(),
tags: self.__unsafe_private_named.6,
title: self.__unsafe_private_named.7,
uri: self.__unsafe_private_named.8.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"chapterView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ContentFormat<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_content_format_markdown")]
#[serde(borrow)]
pub markdown: std::option::Option<jacquard_common::CowStr<'a>>,
}
fn _default_content_format_markdown() -> std::option::Option<
jacquard_common::CowStr<'static>,
> {
Some(jacquard_common::CowStr::from("weaver"))
}
impl Default for ContentFormat<'_> {
fn default() -> Self {
Self {
markdown: Some(jacquard_common::CowStr::from("weaver")),
extra_data: Default::default(),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"contentFormat"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ContentRating<'a> {
General,
Teen,
Mature,
Explicit,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> ContentRating<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::General => "general",
Self::Teen => "teen",
Self::Mature => "mature",
Self::Explicit => "explicit",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ContentRating<'a> {
fn from(s: &'a str) -> Self {
match s {
"general" => Self::General,
"teen" => Self::Teen,
"mature" => Self::Mature,
"explicit" => Self::Explicit,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for ContentRating<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"general" => Self::General,
"teen" => Self::Teen,
"mature" => Self::Mature,
"explicit" => Self::Explicit,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> AsRef<str> for ContentRating<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> core::fmt::Display for ContentRating<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> serde::Serialize for ContentRating<'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 ContentRating<'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 jacquard_common::IntoStatic for ContentRating<'_> {
type Output = ContentRating<'static>;
fn into_static(self) -> Self::Output {
match self {
ContentRating::General => ContentRating::General,
ContentRating::Teen => ContentRating::Teen,
ContentRating::Mature => ContentRating::Mature,
ContentRating::Explicit => ContentRating::Explicit,
ContentRating::Other(v) => ContentRating::Other(v.into_static()),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ContentWarning<'a> {
Violence,
GraphicViolence,
Death,
MajorCharacterDeath,
SexualContent,
ExplicitSexualContent,
Language,
SubstanceUse,
SelfHarm,
Abuse,
DisturbingImagery,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> ContentWarning<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Violence => "violence",
Self::GraphicViolence => "graphic-violence",
Self::Death => "death",
Self::MajorCharacterDeath => "major-character-death",
Self::SexualContent => "sexual-content",
Self::ExplicitSexualContent => "explicit-sexual-content",
Self::Language => "language",
Self::SubstanceUse => "substance-use",
Self::SelfHarm => "self-harm",
Self::Abuse => "abuse",
Self::DisturbingImagery => "disturbing-imagery",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ContentWarning<'a> {
fn from(s: &'a str) -> Self {
match s {
"violence" => Self::Violence,
"graphic-violence" => Self::GraphicViolence,
"death" => Self::Death,
"major-character-death" => Self::MajorCharacterDeath,
"sexual-content" => Self::SexualContent,
"explicit-sexual-content" => Self::ExplicitSexualContent,
"language" => Self::Language,
"substance-use" => Self::SubstanceUse,
"self-harm" => Self::SelfHarm,
"abuse" => Self::Abuse,
"disturbing-imagery" => Self::DisturbingImagery,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for ContentWarning<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"violence" => Self::Violence,
"graphic-violence" => Self::GraphicViolence,
"death" => Self::Death,
"major-character-death" => Self::MajorCharacterDeath,
"sexual-content" => Self::SexualContent,
"explicit-sexual-content" => Self::ExplicitSexualContent,
"language" => Self::Language,
"substance-use" => Self::SubstanceUse,
"self-harm" => Self::SelfHarm,
"abuse" => Self::Abuse,
"disturbing-imagery" => Self::DisturbingImagery,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> AsRef<str> for ContentWarning<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> core::fmt::Display for ContentWarning<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> serde::Serialize for ContentWarning<'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 ContentWarning<'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 jacquard_common::IntoStatic for ContentWarning<'_> {
type Output = ContentWarning<'static>;
fn into_static(self) -> Self::Output {
match self {
ContentWarning::Violence => ContentWarning::Violence,
ContentWarning::GraphicViolence => ContentWarning::GraphicViolence,
ContentWarning::Death => ContentWarning::Death,
ContentWarning::MajorCharacterDeath => ContentWarning::MajorCharacterDeath,
ContentWarning::SexualContent => ContentWarning::SexualContent,
ContentWarning::ExplicitSexualContent => {
ContentWarning::ExplicitSexualContent
}
ContentWarning::Language => ContentWarning::Language,
ContentWarning::SubstanceUse => ContentWarning::SubstanceUse,
ContentWarning::SelfHarm => ContentWarning::SelfHarm,
ContentWarning::Abuse => ContentWarning::Abuse,
ContentWarning::DisturbingImagery => ContentWarning::DisturbingImagery,
ContentWarning::Other(v) => ContentWarning::Other(v.into_static()),
}
}
}
pub type ContentWarnings<'a> = Vec<crate::sh_weaver::notebook::ContentWarning<'a>>;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct EntryView<'a> {
#[serde(borrow)]
pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub bookmark_count: std::option::Option<i64>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub like_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub path: std::option::Option<crate::sh_weaver::notebook::Path<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub permissions: std::option::Option<
crate::sh_weaver::notebook::PermissionsState<'a>,
>,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub rendered_view: std::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_bookmark: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_like: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_reading_progress: std::option::Option<
crate::sh_weaver::notebook::ReadingProgress<'a>,
>,
}
pub mod entry_view_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 IndexedAt;
type Uri;
type Cid;
type Record;
type Authors;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type Uri = Unset;
type Cid = Unset;
type Record = Unset;
type Authors = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
type Uri = S::Uri;
type Cid = S::Cid;
type Record = S::Record;
type Authors = S::Authors;
}
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 IndexedAt = S::IndexedAt;
type Uri = Set<members::uri>;
type Cid = S::Cid;
type Record = S::Record;
type Authors = S::Authors;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Cid = Set<members::cid>;
type Record = S::Record;
type Authors = S::Authors;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Cid = S::Cid;
type Record = Set<members::record>;
type Authors = S::Authors;
}
pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthors<S> {}
impl<S: State> State for SetAuthors<S> {
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Cid = S::Cid;
type Record = S::Record;
type Authors = Set<members::authors>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct uri(());
pub struct cid(());
pub struct record(());
pub struct authors(());
}
}
pub struct EntryViewBuilder<'a, S: entry_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::notebook::Path<'a>>,
::core::option::Option<crate::sh_weaver::notebook::PermissionsState<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<crate::sh_weaver::notebook::ReadingProgress<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> EntryView<'a> {
pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> {
EntryViewBuilder::new()
}
}
impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> {
pub fn new() -> Self {
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::Authors: entry_view_state::IsUnset,
{
pub fn authors(
mut self,
value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
) -> EntryViewBuilder<'a, entry_view_state::SetAuthors<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::Cid: entry_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> EntryViewBuilder<'a, entry_view_state::SetCid<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::IndexedAt: entry_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn path(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Path<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_path(
mut self,
value: Option<crate::sh_weaver::notebook::Path<'a>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn permissions(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::PermissionsState<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_permissions(
mut self,
value: Option<crate::sh_weaver::notebook::PermissionsState<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::Record: entry_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> EntryViewBuilder<'a, entry_view_state::SetRecord<S>> {
self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn rendered_view(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::RenderedView<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_rendered_view(
mut self,
value: Option<crate::sh_weaver::notebook::RenderedView<'a>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<crate::sh_weaver::notebook::Tags<'a>>,
) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn title(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_title(
mut self,
value: Option<crate::sh_weaver::notebook::Title<'a>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::Uri: entry_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> EntryViewBuilder<'a, entry_view_state::SetUri<S>> {
self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into());
EntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn viewer_bookmark(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.12 = value.into();
self
}
pub fn maybe_viewer_bookmark(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.12 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn viewer_like(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.13 = value.into();
self
}
pub fn maybe_viewer_like(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.13 = value;
self
}
}
impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
pub fn viewer_reading_progress(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::ReadingProgress<'a>>>,
) -> Self {
self.__unsafe_private_named.14 = value.into();
self
}
pub fn maybe_viewer_reading_progress(
mut self,
value: Option<crate::sh_weaver::notebook::ReadingProgress<'a>>,
) -> Self {
self.__unsafe_private_named.14 = value;
self
}
}
impl<'a, S> EntryViewBuilder<'a, S>
where
S: entry_view_state::State,
S::IndexedAt: entry_view_state::IsSet,
S::Uri: entry_view_state::IsSet,
S::Cid: entry_view_state::IsSet,
S::Record: entry_view_state::IsSet,
S::Authors: entry_view_state::IsSet,
{
pub fn build(self) -> EntryView<'a> {
EntryView {
authors: self.__unsafe_private_named.0.unwrap(),
bookmark_count: self.__unsafe_private_named.1,
cid: self.__unsafe_private_named.2.unwrap(),
indexed_at: self.__unsafe_private_named.3.unwrap(),
like_count: self.__unsafe_private_named.4,
path: self.__unsafe_private_named.5,
permissions: self.__unsafe_private_named.6,
record: self.__unsafe_private_named.7.unwrap(),
rendered_view: self.__unsafe_private_named.8,
tags: self.__unsafe_private_named.9,
title: self.__unsafe_private_named.10,
uri: self.__unsafe_private_named.11.unwrap(),
viewer_bookmark: self.__unsafe_private_named.12,
viewer_like: self.__unsafe_private_named.13,
viewer_reading_progress: self.__unsafe_private_named.14,
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>,
>,
) -> EntryView<'a> {
EntryView {
authors: self.__unsafe_private_named.0.unwrap(),
bookmark_count: self.__unsafe_private_named.1,
cid: self.__unsafe_private_named.2.unwrap(),
indexed_at: self.__unsafe_private_named.3.unwrap(),
like_count: self.__unsafe_private_named.4,
path: self.__unsafe_private_named.5,
permissions: self.__unsafe_private_named.6,
record: self.__unsafe_private_named.7.unwrap(),
rendered_view: self.__unsafe_private_named.8,
tags: self.__unsafe_private_named.9,
title: self.__unsafe_private_named.10,
uri: self.__unsafe_private_named.11.unwrap(),
viewer_bookmark: self.__unsafe_private_named.12,
viewer_like: self.__unsafe_private_named.13,
viewer_reading_progress: self.__unsafe_private_named.14,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"entryView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 FeedEntryView<'a> {
#[serde(borrow)]
pub entry: crate::sh_weaver::notebook::EntryView<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub notebook_context: std::option::Option<
crate::sh_weaver::notebook::FeedNotebookContext<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub reason: std::option::Option<crate::sh_weaver::notebook::FeedReason<'a>>,
}
pub mod feed_entry_view_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 Entry;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Entry = Unset;
}
pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEntry<S> {}
impl<S: State> State for SetEntry<S> {
type Entry = Set<members::entry>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct entry(());
}
}
pub struct FeedEntryViewBuilder<'a, S: feed_entry_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
::core::option::Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>,
::core::option::Option<crate::sh_weaver::notebook::FeedReason<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> FeedEntryView<'a> {
pub fn new() -> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> {
FeedEntryViewBuilder::new()
}
}
impl<'a> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> {
pub fn new() -> Self {
FeedEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FeedEntryViewBuilder<'a, S>
where
S: feed_entry_view_state::State,
S::Entry: feed_entry_view_state::IsUnset,
{
pub fn entry(
mut self,
value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
) -> FeedEntryViewBuilder<'a, feed_entry_view_state::SetEntry<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
FeedEntryViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> {
pub fn notebook_context(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_notebook_context(
mut self,
value: Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> {
pub fn reason(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::FeedReason<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_reason(
mut self,
value: Option<crate::sh_weaver::notebook::FeedReason<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> FeedEntryViewBuilder<'a, S>
where
S: feed_entry_view_state::State,
S::Entry: feed_entry_view_state::IsSet,
{
pub fn build(self) -> FeedEntryView<'a> {
FeedEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
notebook_context: self.__unsafe_private_named.1,
reason: self.__unsafe_private_named.2,
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>,
>,
) -> FeedEntryView<'a> {
FeedEntryView {
entry: self.__unsafe_private_named.0.unwrap(),
notebook_context: self.__unsafe_private_named.1,
reason: self.__unsafe_private_named.2,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedEntryView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"feedEntryView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 FeedNotebookContext<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub path: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub title: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod feed_notebook_context_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 Title;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Title = Unset;
type Uri = Unset;
}
pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTitle<S> {}
impl<S: State> State for SetTitle<S> {
type Title = Set<members::title>;
type Uri = S::Uri;
}
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 Title = S::Title;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct title(());
pub struct uri(());
}
}
pub struct FeedNotebookContextBuilder<'a, S: feed_notebook_context_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> FeedNotebookContext<'a> {
pub fn new() -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> {
FeedNotebookContextBuilder::new()
}
}
impl<'a> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> {
pub fn new() -> Self {
FeedNotebookContextBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: feed_notebook_context_state::State> FeedNotebookContextBuilder<'a, S> {
pub fn path(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_path(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> FeedNotebookContextBuilder<'a, S>
where
S: feed_notebook_context_state::State,
S::Title: feed_notebook_context_state::IsUnset,
{
pub fn title(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetTitle<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
FeedNotebookContextBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FeedNotebookContextBuilder<'a, S>
where
S: feed_notebook_context_state::State,
S::Uri: feed_notebook_context_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetUri<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
FeedNotebookContextBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FeedNotebookContextBuilder<'a, S>
where
S: feed_notebook_context_state::State,
S::Title: feed_notebook_context_state::IsSet,
S::Uri: feed_notebook_context_state::IsSet,
{
pub fn build(self) -> FeedNotebookContext<'a> {
FeedNotebookContext {
path: self.__unsafe_private_named.0,
title: self.__unsafe_private_named.1.unwrap(),
uri: 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>,
>,
) -> FeedNotebookContext<'a> {
FeedNotebookContext {
path: self.__unsafe_private_named.0,
title: self.__unsafe_private_named.1.unwrap(),
uri: self.__unsafe_private_named.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedNotebookContext<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"feedNotebookContext"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[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 FeedReason<'a> {
#[serde(rename = "sh.weaver.notebook.defs#reasonLike")]
ReasonLike(Box<crate::sh_weaver::notebook::ReasonLike<'a>>),
#[serde(rename = "sh.weaver.notebook.defs#reasonBookmark")]
ReasonBookmark(Box<crate::sh_weaver::notebook::ReasonBookmark<'a>>),
#[serde(rename = "sh.weaver.notebook.defs#reasonSubscription")]
ReasonSubscription(Box<crate::sh_weaver::notebook::ReasonSubscription<'a>>),
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct NotebookView<'a> {
#[serde(borrow)]
pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub bookmark_count: std::option::Option<i64>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub entry_count: std::option::Option<i64>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub like_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub path: std::option::Option<crate::sh_weaver::notebook::Path<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub permissions: std::option::Option<
crate::sh_weaver::notebook::PermissionsState<'a>,
>,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub subscriber_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_bookmark: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_like: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_reading_progress: std::option::Option<
crate::sh_weaver::notebook::ReadingProgress<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_subscription: std::option::Option<
jacquard_common::types::string::AtUri<'a>,
>,
}
pub mod notebook_view_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 Cid;
type IndexedAt;
type Uri;
type Authors;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cid = Unset;
type IndexedAt = Unset;
type Uri = Unset;
type Authors = Unset;
type Record = Unset;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Cid = Set<members::cid>;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Authors = S::Authors;
type Record = S::Record;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Cid = S::Cid;
type IndexedAt = Set<members::indexed_at>;
type Uri = S::Uri;
type Authors = S::Authors;
type Record = S::Record;
}
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 Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = Set<members::uri>;
type Authors = S::Authors;
type Record = S::Record;
}
pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthors<S> {}
impl<S: State> State for SetAuthors<S> {
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Authors = Set<members::authors>;
type Record = S::Record;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Authors = S::Authors;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cid(());
pub struct indexed_at(());
pub struct uri(());
pub struct authors(());
pub struct record(());
}
}
pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::notebook::Path<'a>>,
::core::option::Option<crate::sh_weaver::notebook::PermissionsState<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<i64>,
::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<crate::sh_weaver::notebook::ReadingProgress<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> NotebookView<'a> {
pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> {
NotebookViewBuilder::new()
}
}
impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> {
pub fn new() -> Self {
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::Authors: notebook_view_state::IsUnset,
{
pub fn authors(
mut self,
value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>,
) -> NotebookViewBuilder<'a, notebook_view_state::SetAuthors<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::Cid: notebook_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> NotebookViewBuilder<'a, notebook_view_state::SetCid<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::IndexedAt: notebook_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn path(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Path<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_path(
mut self,
value: Option<crate::sh_weaver::notebook::Path<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn permissions(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::PermissionsState<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_permissions(
mut self,
value: Option<crate::sh_weaver::notebook::PermissionsState<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::Record: notebook_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord<S>> {
self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into());
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<crate::sh_weaver::notebook::Tags<'a>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn title(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
) -> Self {
self.__unsafe_private_named.11 = value.into();
self
}
pub fn maybe_title(
mut self,
value: Option<crate::sh_weaver::notebook::Title<'a>>,
) -> Self {
self.__unsafe_private_named.11 = value;
self
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::Uri: notebook_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> NotebookViewBuilder<'a, notebook_view_state::SetUri<S>> {
self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into());
NotebookViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn viewer_bookmark(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.13 = value.into();
self
}
pub fn maybe_viewer_bookmark(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.13 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn viewer_like(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.14 = value.into();
self
}
pub fn maybe_viewer_like(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.14 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn viewer_reading_progress(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::ReadingProgress<'a>>>,
) -> Self {
self.__unsafe_private_named.15 = value.into();
self
}
pub fn maybe_viewer_reading_progress(
mut self,
value: Option<crate::sh_weaver::notebook::ReadingProgress<'a>>,
) -> Self {
self.__unsafe_private_named.15 = value;
self
}
}
impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
pub fn viewer_subscription(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.16 = value.into();
self
}
pub fn maybe_viewer_subscription(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.16 = value;
self
}
}
impl<'a, S> NotebookViewBuilder<'a, S>
where
S: notebook_view_state::State,
S::Cid: notebook_view_state::IsSet,
S::IndexedAt: notebook_view_state::IsSet,
S::Uri: notebook_view_state::IsSet,
S::Authors: notebook_view_state::IsSet,
S::Record: notebook_view_state::IsSet,
{
pub fn build(self) -> NotebookView<'a> {
NotebookView {
authors: self.__unsafe_private_named.0.unwrap(),
bookmark_count: self.__unsafe_private_named.1,
cid: self.__unsafe_private_named.2.unwrap(),
entry_count: self.__unsafe_private_named.3,
indexed_at: self.__unsafe_private_named.4.unwrap(),
like_count: self.__unsafe_private_named.5,
path: self.__unsafe_private_named.6,
permissions: self.__unsafe_private_named.7,
record: self.__unsafe_private_named.8.unwrap(),
subscriber_count: self.__unsafe_private_named.9,
tags: self.__unsafe_private_named.10,
title: self.__unsafe_private_named.11,
uri: self.__unsafe_private_named.12.unwrap(),
viewer_bookmark: self.__unsafe_private_named.13,
viewer_like: self.__unsafe_private_named.14,
viewer_reading_progress: self.__unsafe_private_named.15,
viewer_subscription: self.__unsafe_private_named.16,
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>,
>,
) -> NotebookView<'a> {
NotebookView {
authors: self.__unsafe_private_named.0.unwrap(),
bookmark_count: self.__unsafe_private_named.1,
cid: self.__unsafe_private_named.2.unwrap(),
entry_count: self.__unsafe_private_named.3,
indexed_at: self.__unsafe_private_named.4.unwrap(),
like_count: self.__unsafe_private_named.5,
path: self.__unsafe_private_named.6,
permissions: self.__unsafe_private_named.7,
record: self.__unsafe_private_named.8.unwrap(),
subscriber_count: self.__unsafe_private_named.9,
tags: self.__unsafe_private_named.10,
title: self.__unsafe_private_named.11,
uri: self.__unsafe_private_named.12.unwrap(),
viewer_bookmark: self.__unsafe_private_named.13,
viewer_like: self.__unsafe_private_named.14,
viewer_reading_progress: self.__unsafe_private_named.15,
viewer_subscription: self.__unsafe_private_named.16,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"notebookView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 PageView<'a> {
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub entry_count: std::option::Option<i64>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub notebook: crate::sh_weaver::notebook::NotebookView<'a>,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod page_view_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 Notebook;
type Cid;
type Uri;
type Record;
type IndexedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Notebook = Unset;
type Cid = Unset;
type Uri = Unset;
type Record = Unset;
type IndexedAt = Unset;
}
pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNotebook<S> {}
impl<S: State> State for SetNotebook<S> {
type Notebook = Set<members::notebook>;
type Cid = S::Cid;
type Uri = S::Uri;
type Record = S::Record;
type IndexedAt = S::IndexedAt;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Notebook = S::Notebook;
type Cid = Set<members::cid>;
type Uri = S::Uri;
type Record = S::Record;
type IndexedAt = S::IndexedAt;
}
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 Notebook = S::Notebook;
type Cid = S::Cid;
type Uri = Set<members::uri>;
type Record = S::Record;
type IndexedAt = S::IndexedAt;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Notebook = S::Notebook;
type Cid = S::Cid;
type Uri = S::Uri;
type Record = Set<members::record>;
type IndexedAt = S::IndexedAt;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Notebook = S::Notebook;
type Cid = S::Cid;
type Uri = S::Uri;
type Record = S::Record;
type IndexedAt = Set<members::indexed_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct notebook(());
pub struct cid(());
pub struct uri(());
pub struct record(());
pub struct indexed_at(());
}
}
pub struct PageViewBuilder<'a, S: page_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::sh_weaver::notebook::NotebookView<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PageView<'a> {
pub fn new() -> PageViewBuilder<'a, page_view_state::Empty> {
PageViewBuilder::new()
}
}
impl<'a> PageViewBuilder<'a, page_view_state::Empty> {
pub fn new() -> Self {
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::Cid: page_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> PageViewBuilder<'a, page_view_state::SetCid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> {
pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::IndexedAt: page_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> PageViewBuilder<'a, page_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::Notebook: page_view_state::IsUnset,
{
pub fn notebook(
mut self,
value: impl Into<crate::sh_weaver::notebook::NotebookView<'a>>,
) -> PageViewBuilder<'a, page_view_state::SetNotebook<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::Record: page_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> PageViewBuilder<'a, page_view_state::SetRecord<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<crate::sh_weaver::notebook::Tags<'a>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> {
pub fn title(
mut self,
value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_title(
mut self,
value: Option<crate::sh_weaver::notebook::Title<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::Uri: page_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PageViewBuilder<'a, page_view_state::SetUri<S>> {
self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
PageViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PageViewBuilder<'a, S>
where
S: page_view_state::State,
S::Notebook: page_view_state::IsSet,
S::Cid: page_view_state::IsSet,
S::Uri: page_view_state::IsSet,
S::Record: page_view_state::IsSet,
S::IndexedAt: page_view_state::IsSet,
{
pub fn build(self) -> PageView<'a> {
PageView {
cid: self.__unsafe_private_named.0.unwrap(),
entry_count: self.__unsafe_private_named.1,
indexed_at: self.__unsafe_private_named.2.unwrap(),
notebook: self.__unsafe_private_named.3.unwrap(),
record: self.__unsafe_private_named.4.unwrap(),
tags: self.__unsafe_private_named.5,
title: self.__unsafe_private_named.6,
uri: self.__unsafe_private_named.7.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>,
>,
) -> PageView<'a> {
PageView {
cid: self.__unsafe_private_named.0.unwrap(),
entry_count: self.__unsafe_private_named.1,
indexed_at: self.__unsafe_private_named.2.unwrap(),
notebook: self.__unsafe_private_named.3.unwrap(),
record: self.__unsafe_private_named.4.unwrap(),
tags: self.__unsafe_private_named.5,
title: self.__unsafe_private_named.6,
uri: self.__unsafe_private_named.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PageView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"pageView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
pub type Path<'a> = jacquard_common::CowStr<'a>;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct PermissionGrant<'a> {
#[serde(borrow)]
pub did: jacquard_common::types::string::Did<'a>,
pub granted_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub scope: PermissionGrantScope<'a>,
#[serde(borrow)]
pub source: jacquard_common::types::string::AtUri<'a>,
}
pub mod permission_grant_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 Source;
type Scope;
type Did;
type GrantedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Source = Unset;
type Scope = Unset;
type Did = Unset;
type GrantedAt = Unset;
}
pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSource<S> {}
impl<S: State> State for SetSource<S> {
type Source = Set<members::source>;
type Scope = S::Scope;
type Did = S::Did;
type GrantedAt = S::GrantedAt;
}
pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetScope<S> {}
impl<S: State> State for SetScope<S> {
type Source = S::Source;
type Scope = Set<members::scope>;
type Did = S::Did;
type GrantedAt = S::GrantedAt;
}
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 Source = S::Source;
type Scope = S::Scope;
type Did = Set<members::did>;
type GrantedAt = S::GrantedAt;
}
pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetGrantedAt<S> {}
impl<S: State> State for SetGrantedAt<S> {
type Source = S::Source;
type Scope = S::Scope;
type Did = S::Did;
type GrantedAt = Set<members::granted_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct source(());
pub struct scope(());
pub struct did(());
pub struct granted_at(());
}
}
pub struct PermissionGrantBuilder<'a, S: permission_grant_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<PermissionGrantScope<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PermissionGrant<'a> {
pub fn new() -> PermissionGrantBuilder<'a, permission_grant_state::Empty> {
PermissionGrantBuilder::new()
}
}
impl<'a> PermissionGrantBuilder<'a, permission_grant_state::Empty> {
pub fn new() -> Self {
PermissionGrantBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionGrantBuilder<'a, S>
where
S: permission_grant_state::State,
S::Did: permission_grant_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> PermissionGrantBuilder<'a, permission_grant_state::SetDid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PermissionGrantBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionGrantBuilder<'a, S>
where
S: permission_grant_state::State,
S::GrantedAt: permission_grant_state::IsUnset,
{
pub fn granted_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> PermissionGrantBuilder<'a, permission_grant_state::SetGrantedAt<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
PermissionGrantBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionGrantBuilder<'a, S>
where
S: permission_grant_state::State,
S::Scope: permission_grant_state::IsUnset,
{
pub fn scope(
mut self,
value: impl Into<PermissionGrantScope<'a>>,
) -> PermissionGrantBuilder<'a, permission_grant_state::SetScope<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
PermissionGrantBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionGrantBuilder<'a, S>
where
S: permission_grant_state::State,
S::Source: permission_grant_state::IsUnset,
{
pub fn source(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PermissionGrantBuilder<'a, permission_grant_state::SetSource<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
PermissionGrantBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionGrantBuilder<'a, S>
where
S: permission_grant_state::State,
S::Source: permission_grant_state::IsSet,
S::Scope: permission_grant_state::IsSet,
S::Did: permission_grant_state::IsSet,
S::GrantedAt: permission_grant_state::IsSet,
{
pub fn build(self) -> PermissionGrant<'a> {
PermissionGrant {
did: self.__unsafe_private_named.0.unwrap(),
granted_at: self.__unsafe_private_named.1.unwrap(),
scope: self.__unsafe_private_named.2.unwrap(),
source: self.__unsafe_private_named.3.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>,
>,
) -> PermissionGrant<'a> {
PermissionGrant {
did: self.__unsafe_private_named.0.unwrap(),
granted_at: self.__unsafe_private_named.1.unwrap(),
scope: self.__unsafe_private_named.2.unwrap(),
source: self.__unsafe_private_named.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PermissionGrantScope<'a> {
Direct,
Inherited,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> PermissionGrantScope<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Direct => "direct",
Self::Inherited => "inherited",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for PermissionGrantScope<'a> {
fn from(s: &'a str) -> Self {
match s {
"direct" => Self::Direct,
"inherited" => Self::Inherited,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for PermissionGrantScope<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"direct" => Self::Direct,
"inherited" => Self::Inherited,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for PermissionGrantScope<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for PermissionGrantScope<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for PermissionGrantScope<'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 PermissionGrantScope<'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 PermissionGrantScope<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for PermissionGrantScope<'_> {
type Output = PermissionGrantScope<'static>;
fn into_static(self) -> Self::Output {
match self {
PermissionGrantScope::Direct => PermissionGrantScope::Direct,
PermissionGrantScope::Inherited => PermissionGrantScope::Inherited,
PermissionGrantScope::Other(v) => {
PermissionGrantScope::Other(v.into_static())
}
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"permissionGrant"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 PermissionsState<'a> {
#[serde(borrow)]
pub editors: Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewers: std::option::Option<
Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>,
>,
}
pub mod permissions_state_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 Editors;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Editors = Unset;
}
pub struct SetEditors<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEditors<S> {}
impl<S: State> State for SetEditors<S> {
type Editors = Set<members::editors>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct editors(());
}
}
pub struct PermissionsStateBuilder<'a, S: permissions_state_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>,
::core::option::Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PermissionsState<'a> {
pub fn new() -> PermissionsStateBuilder<'a, permissions_state_state::Empty> {
PermissionsStateBuilder::new()
}
}
impl<'a> PermissionsStateBuilder<'a, permissions_state_state::Empty> {
pub fn new() -> Self {
PermissionsStateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PermissionsStateBuilder<'a, S>
where
S: permissions_state_state::State,
S::Editors: permissions_state_state::IsUnset,
{
pub fn editors(
mut self,
value: impl Into<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>,
) -> PermissionsStateBuilder<'a, permissions_state_state::SetEditors<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PermissionsStateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: permissions_state_state::State> PermissionsStateBuilder<'a, S> {
pub fn viewers(
mut self,
value: impl Into<Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_viewers(
mut self,
value: Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> PermissionsStateBuilder<'a, S>
where
S: permissions_state_state::State,
S::Editors: permissions_state_state::IsSet,
{
pub fn build(self) -> PermissionsState<'a> {
PermissionsState {
editors: self.__unsafe_private_named.0.unwrap(),
viewers: self.__unsafe_private_named.1,
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>,
>,
) -> PermissionsState<'a> {
PermissionsState {
editors: self.__unsafe_private_named.0.unwrap(),
viewers: self.__unsafe_private_named.1,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"permissionsState"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 PublishedVersionView<'a> {
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub diverged_from: std::option::Option<
crate::com_atproto::repo::strong_ref::StrongRef<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub is_canonical: std::option::Option<bool>,
pub published_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub publisher: crate::sh_weaver::actor::ProfileViewBasic<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod published_version_view_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 Publisher;
type Cid;
type PublishedAt;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Publisher = Unset;
type Cid = Unset;
type PublishedAt = Unset;
type Uri = Unset;
}
pub struct SetPublisher<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPublisher<S> {}
impl<S: State> State for SetPublisher<S> {
type Publisher = Set<members::publisher>;
type Cid = S::Cid;
type PublishedAt = S::PublishedAt;
type Uri = S::Uri;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Publisher = S::Publisher;
type Cid = Set<members::cid>;
type PublishedAt = S::PublishedAt;
type Uri = S::Uri;
}
pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPublishedAt<S> {}
impl<S: State> State for SetPublishedAt<S> {
type Publisher = S::Publisher;
type Cid = S::Cid;
type PublishedAt = Set<members::published_at>;
type Uri = S::Uri;
}
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 Publisher = S::Publisher;
type Cid = S::Cid;
type PublishedAt = S::PublishedAt;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct publisher(());
pub struct cid(());
pub struct published_at(());
pub struct uri(());
}
}
pub struct PublishedVersionViewBuilder<'a, S: published_version_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
::core::option::Option<bool>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PublishedVersionView<'a> {
pub fn new() -> PublishedVersionViewBuilder<
'a,
published_version_view_state::Empty,
> {
PublishedVersionViewBuilder::new()
}
}
impl<'a> PublishedVersionViewBuilder<'a, published_version_view_state::Empty> {
pub fn new() -> Self {
PublishedVersionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PublishedVersionViewBuilder<'a, S>
where
S: published_version_view_state::State,
S::Cid: published_version_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetCid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PublishedVersionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> {
pub fn diverged_from(
mut self,
value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_diverged_from(
mut self,
value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> {
pub fn is_canonical(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_is_canonical(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> PublishedVersionViewBuilder<'a, S>
where
S: published_version_view_state::State,
S::PublishedAt: published_version_view_state::IsUnset,
{
pub fn published_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> PublishedVersionViewBuilder<
'a,
published_version_view_state::SetPublishedAt<S>,
> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
PublishedVersionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PublishedVersionViewBuilder<'a, S>
where
S: published_version_view_state::State,
S::Publisher: published_version_view_state::IsUnset,
{
pub fn publisher(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetPublisher<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
PublishedVersionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> {
pub fn updated_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_updated_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S> PublishedVersionViewBuilder<'a, S>
where
S: published_version_view_state::State,
S::Uri: published_version_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetUri<S>> {
self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
PublishedVersionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PublishedVersionViewBuilder<'a, S>
where
S: published_version_view_state::State,
S::Publisher: published_version_view_state::IsSet,
S::Cid: published_version_view_state::IsSet,
S::PublishedAt: published_version_view_state::IsSet,
S::Uri: published_version_view_state::IsSet,
{
pub fn build(self) -> PublishedVersionView<'a> {
PublishedVersionView {
cid: self.__unsafe_private_named.0.unwrap(),
diverged_from: self.__unsafe_private_named.1,
is_canonical: self.__unsafe_private_named.2,
published_at: self.__unsafe_private_named.3.unwrap(),
publisher: self.__unsafe_private_named.4.unwrap(),
updated_at: self.__unsafe_private_named.5,
uri: self.__unsafe_private_named.6.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>,
>,
) -> PublishedVersionView<'a> {
PublishedVersionView {
cid: self.__unsafe_private_named.0.unwrap(),
diverged_from: self.__unsafe_private_named.1,
is_canonical: self.__unsafe_private_named.2,
published_at: self.__unsafe_private_named.3.unwrap(),
publisher: self.__unsafe_private_named.4.unwrap(),
updated_at: self.__unsafe_private_named.5,
uri: self.__unsafe_private_named.6.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublishedVersionView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"publishedVersionView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ReadingProgress<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub current_entry: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub finished_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub last_read_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub percent_complete: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub started_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub status: std::option::Option<ReadingProgressStatus<'a>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReadingProgressStatus<'a> {
Reading,
Finished,
Abandoned,
WantToRead,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> ReadingProgressStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Reading => "reading",
Self::Finished => "finished",
Self::Abandoned => "abandoned",
Self::WantToRead => "want-to-read",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ReadingProgressStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"reading" => Self::Reading,
"finished" => Self::Finished,
"abandoned" => Self::Abandoned,
"want-to-read" => Self::WantToRead,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for ReadingProgressStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"reading" => Self::Reading,
"finished" => Self::Finished,
"abandoned" => Self::Abandoned,
"want-to-read" => Self::WantToRead,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ReadingProgressStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ReadingProgressStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ReadingProgressStatus<'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 ReadingProgressStatus<'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 ReadingProgressStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ReadingProgressStatus<'_> {
type Output = ReadingProgressStatus<'static>;
fn into_static(self) -> Self::Output {
match self {
ReadingProgressStatus::Reading => ReadingProgressStatus::Reading,
ReadingProgressStatus::Finished => ReadingProgressStatus::Finished,
ReadingProgressStatus::Abandoned => ReadingProgressStatus::Abandoned,
ReadingProgressStatus::WantToRead => ReadingProgressStatus::WantToRead,
ReadingProgressStatus::Other(v) => {
ReadingProgressStatus::Other(v.into_static())
}
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReadingProgress<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"readingProgress"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.percent_complete {
if *value > 100i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Maximum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"percent_complete",
),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.percent_complete {
if *value < 0i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"percent_complete",
),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ReasonBookmark<'a> {
#[serde(borrow)]
pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>,
pub indexed_at: jacquard_common::types::string::Datetime,
}
pub mod reason_bookmark_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 IndexedAt;
type By;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type By = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
type By = S::By;
}
pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBy<S> {}
impl<S: State> State for SetBy<S> {
type IndexedAt = S::IndexedAt;
type By = Set<members::by>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct by(());
}
}
pub struct ReasonBookmarkBuilder<'a, S: reason_bookmark_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ReasonBookmark<'a> {
pub fn new() -> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> {
ReasonBookmarkBuilder::new()
}
}
impl<'a> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> {
pub fn new() -> Self {
ReasonBookmarkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonBookmarkBuilder<'a, S>
where
S: reason_bookmark_state::State,
S::By: reason_bookmark_state::IsUnset,
{
pub fn by(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetBy<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ReasonBookmarkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonBookmarkBuilder<'a, S>
where
S: reason_bookmark_state::State,
S::IndexedAt: reason_bookmark_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetIndexedAt<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ReasonBookmarkBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonBookmarkBuilder<'a, S>
where
S: reason_bookmark_state::State,
S::IndexedAt: reason_bookmark_state::IsSet,
S::By: reason_bookmark_state::IsSet,
{
pub fn build(self) -> ReasonBookmark<'a> {
ReasonBookmark {
by: self.__unsafe_private_named.0.unwrap(),
indexed_at: 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>,
>,
) -> ReasonBookmark<'a> {
ReasonBookmark {
by: self.__unsafe_private_named.0.unwrap(),
indexed_at: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonBookmark<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"reasonBookmark"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ReasonLike<'a> {
#[serde(borrow)]
pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>,
pub indexed_at: jacquard_common::types::string::Datetime,
}
pub mod reason_like_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 IndexedAt;
type By;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type By = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
type By = S::By;
}
pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBy<S> {}
impl<S: State> State for SetBy<S> {
type IndexedAt = S::IndexedAt;
type By = Set<members::by>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct by(());
}
}
pub struct ReasonLikeBuilder<'a, S: reason_like_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ReasonLike<'a> {
pub fn new() -> ReasonLikeBuilder<'a, reason_like_state::Empty> {
ReasonLikeBuilder::new()
}
}
impl<'a> ReasonLikeBuilder<'a, reason_like_state::Empty> {
pub fn new() -> Self {
ReasonLikeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonLikeBuilder<'a, S>
where
S: reason_like_state::State,
S::By: reason_like_state::IsUnset,
{
pub fn by(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> ReasonLikeBuilder<'a, reason_like_state::SetBy<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ReasonLikeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonLikeBuilder<'a, S>
where
S: reason_like_state::State,
S::IndexedAt: reason_like_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ReasonLikeBuilder<'a, reason_like_state::SetIndexedAt<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ReasonLikeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonLikeBuilder<'a, S>
where
S: reason_like_state::State,
S::IndexedAt: reason_like_state::IsSet,
S::By: reason_like_state::IsSet,
{
pub fn build(self) -> ReasonLike<'a> {
ReasonLike {
by: self.__unsafe_private_named.0.unwrap(),
indexed_at: 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>,
>,
) -> ReasonLike<'a> {
ReasonLike {
by: self.__unsafe_private_named.0.unwrap(),
indexed_at: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonLike<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"reasonLike"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 ReasonSubscription<'a> {
pub indexed_at: jacquard_common::types::string::Datetime,
}
pub mod reason_subscription_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 IndexedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
}
}
pub struct ReasonSubscriptionBuilder<'a, S: reason_subscription_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ReasonSubscription<'a> {
pub fn new() -> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> {
ReasonSubscriptionBuilder::new()
}
}
impl<'a> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> {
pub fn new() -> Self {
ReasonSubscriptionBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonSubscriptionBuilder<'a, S>
where
S: reason_subscription_state::State,
S::IndexedAt: reason_subscription_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ReasonSubscriptionBuilder<'a, reason_subscription_state::SetIndexedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ReasonSubscriptionBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReasonSubscriptionBuilder<'a, S>
where
S: reason_subscription_state::State,
S::IndexedAt: reason_subscription_state::IsSet,
{
pub fn build(self) -> ReasonSubscription<'a> {
ReasonSubscription {
indexed_at: 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>,
>,
) -> ReasonSubscription<'a> {
ReasonSubscription {
indexed_at: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonSubscription<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"reasonSubscription"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_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 RenderedView<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub css: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
#[serde(borrow)]
pub html: jacquard_common::types::blob::BlobRef<'a>,
}
pub mod rendered_view_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 Html;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Html = Unset;
}
pub struct SetHtml<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHtml<S> {}
impl<S: State> State for SetHtml<S> {
type Html = Set<members::html>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct html(());
}
}
pub struct RenderedViewBuilder<'a, S: rendered_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RenderedView<'a> {
pub fn new() -> RenderedViewBuilder<'a, rendered_view_state::Empty> {
RenderedViewBuilder::new()
}
}
impl<'a> RenderedViewBuilder<'a, rendered_view_state::Empty> {
pub fn new() -> Self {
RenderedViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> {
pub fn css(
mut self,
value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_css(
mut self,
value: Option<jacquard_common::types::blob::BlobRef<'a>>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> RenderedViewBuilder<'a, S>
where
S: rendered_view_state::State,
S::Html: rendered_view_state::IsUnset,
{
pub fn html(
mut self,
value: impl Into<jacquard_common::types::blob::BlobRef<'a>>,
) -> RenderedViewBuilder<'a, rendered_view_state::SetHtml<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RenderedViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RenderedViewBuilder<'a, S>
where
S: rendered_view_state::State,
S::Html: rendered_view_state::IsSet,
{
pub fn build(self) -> RenderedView<'a> {
RenderedView {
css: self.__unsafe_private_named.0,
html: 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>,
>,
) -> RenderedView<'a> {
RenderedView {
css: self.__unsafe_private_named.0,
html: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> {
fn nsid() -> &'static str {
"sh.weaver.notebook.defs"
}
fn def_name() -> &'static str {
"renderedView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_notebook_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.css {
{
let size = value.blob().size;
if size > 1000000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobTooLarge {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"css",
),
max: 1000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.css {
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["text/css"];
let matched = accepted
.iter()
.any(|pattern| {
if *pattern == "*/*" {
true
} else if pattern.ends_with("/*") {
let prefix = &pattern[..pattern.len() - 2];
mime.starts_with(prefix)
&& mime.as_bytes().get(prefix.len()) == Some(&b'/')
} else {
mime == *pattern
}
});
if !matched {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobMimeTypeNotAccepted {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"css",
),
accepted: vec!["text/css".to_string()],
actual: mime.to_string(),
});
}
}
}
{
let value = &self.html;
{
let size = value.blob().size;
if size > 1000000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobTooLarge {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"html",
),
max: 1000000usize,
actual: size,
});
}
}
}
{
let value = &self.html;
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["text/html"];
let matched = accepted
.iter()
.any(|pattern| {
if *pattern == "*/*" {
true
} else if pattern.ends_with("/*") {
let prefix = &pattern[..pattern.len() - 2];
mime.starts_with(prefix)
&& mime.as_bytes().get(prefix.len()) == Some(&b'/')
} else {
mime == *pattern
}
});
if !matched {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobMimeTypeNotAccepted {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"html",
),
accepted: vec!["text/html".to_string()],
actual: mime.to_string(),
});
}
}
}
Ok(())
}
}
pub type Tags<'a> = Vec<jacquard_common::CowStr<'a>>;
pub type Title<'a> = jacquard_common::CowStr<'a>;