atproto blogging
at main 6872 lines 263 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.weaver.notebook.defs 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8pub mod authors; 9pub mod book; 10pub mod chapter; 11pub mod colour_scheme; 12pub mod entry; 13pub mod get_book_entry; 14pub mod get_chapter; 15pub mod get_continue_reading; 16pub mod get_entry; 17pub mod get_entry_by_title; 18pub mod get_entry_detail; 19pub mod get_entry_feed; 20pub mod get_entry_notebooks; 21pub mod get_notebook; 22pub mod get_notebook_by_title; 23pub mod get_notebook_chapters; 24pub mod get_notebook_detail; 25pub mod get_notebook_feed; 26pub mod get_page; 27pub mod get_published_versions; 28pub mod get_reading_history; 29pub mod get_similar_notebooks; 30pub mod get_suggested_notebooks; 31pub mod page; 32pub mod resolve_entry; 33pub mod resolve_global_notebook; 34pub mod resolve_notebook; 35pub mod resolve_version_conflict; 36pub mod search_entries; 37pub mod search_notebooks; 38pub mod theme; 39pub mod update_reading_progress; 40 41#[jacquard_derive::lexicon] 42#[derive( 43 serde::Serialize, 44 serde::Deserialize, 45 Debug, 46 Clone, 47 PartialEq, 48 Eq, 49 jacquard_derive::IntoStatic 50)] 51#[serde(rename_all = "camelCase")] 52pub struct AuthorListView<'a> { 53 pub index: i64, 54 #[serde(borrow)] 55 pub record: crate::sh_weaver::actor::ProfileDataView<'a>, 56 #[serde(skip_serializing_if = "std::option::Option::is_none")] 57 #[serde(borrow)] 58 pub uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 59} 60 61pub mod author_list_view_state { 62 63 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 64 #[allow(unused)] 65 use ::core::marker::PhantomData; 66 mod sealed { 67 pub trait Sealed {} 68 } 69 /// State trait tracking which required fields have been set 70 pub trait State: sealed::Sealed { 71 type Record; 72 type Index; 73 } 74 /// Empty state - all required fields are unset 75 pub struct Empty(()); 76 impl sealed::Sealed for Empty {} 77 impl State for Empty { 78 type Record = Unset; 79 type Index = Unset; 80 } 81 ///State transition - sets the `record` field to Set 82 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 83 impl<S: State> sealed::Sealed for SetRecord<S> {} 84 impl<S: State> State for SetRecord<S> { 85 type Record = Set<members::record>; 86 type Index = S::Index; 87 } 88 ///State transition - sets the `index` field to Set 89 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 90 impl<S: State> sealed::Sealed for SetIndex<S> {} 91 impl<S: State> State for SetIndex<S> { 92 type Record = S::Record; 93 type Index = Set<members::index>; 94 } 95 /// Marker types for field names 96 #[allow(non_camel_case_types)] 97 pub mod members { 98 ///Marker type for the `record` field 99 pub struct record(()); 100 ///Marker type for the `index` field 101 pub struct index(()); 102 } 103} 104 105/// Builder for constructing an instance of this type 106pub struct AuthorListViewBuilder<'a, S: author_list_view_state::State> { 107 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 108 __unsafe_private_named: ( 109 ::core::option::Option<i64>, 110 ::core::option::Option<crate::sh_weaver::actor::ProfileDataView<'a>>, 111 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 112 ), 113 _phantom: ::core::marker::PhantomData<&'a ()>, 114} 115 116impl<'a> AuthorListView<'a> { 117 /// Create a new builder for this type 118 pub fn new() -> AuthorListViewBuilder<'a, author_list_view_state::Empty> { 119 AuthorListViewBuilder::new() 120 } 121} 122 123impl<'a> AuthorListViewBuilder<'a, author_list_view_state::Empty> { 124 /// Create a new builder with all fields unset 125 pub fn new() -> Self { 126 AuthorListViewBuilder { 127 _phantom_state: ::core::marker::PhantomData, 128 __unsafe_private_named: (None, None, None), 129 _phantom: ::core::marker::PhantomData, 130 } 131 } 132} 133 134impl<'a, S> AuthorListViewBuilder<'a, S> 135where 136 S: author_list_view_state::State, 137 S::Index: author_list_view_state::IsUnset, 138{ 139 /// Set the `index` field (required) 140 pub fn index( 141 mut self, 142 value: impl Into<i64>, 143 ) -> AuthorListViewBuilder<'a, author_list_view_state::SetIndex<S>> { 144 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 145 AuthorListViewBuilder { 146 _phantom_state: ::core::marker::PhantomData, 147 __unsafe_private_named: self.__unsafe_private_named, 148 _phantom: ::core::marker::PhantomData, 149 } 150 } 151} 152 153impl<'a, S> AuthorListViewBuilder<'a, S> 154where 155 S: author_list_view_state::State, 156 S::Record: author_list_view_state::IsUnset, 157{ 158 /// Set the `record` field (required) 159 pub fn record( 160 mut self, 161 value: impl Into<crate::sh_weaver::actor::ProfileDataView<'a>>, 162 ) -> AuthorListViewBuilder<'a, author_list_view_state::SetRecord<S>> { 163 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 164 AuthorListViewBuilder { 165 _phantom_state: ::core::marker::PhantomData, 166 __unsafe_private_named: self.__unsafe_private_named, 167 _phantom: ::core::marker::PhantomData, 168 } 169 } 170} 171 172impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { 173 /// Set the `uri` field (optional) 174 pub fn uri( 175 mut self, 176 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 177 ) -> Self { 178 self.__unsafe_private_named.2 = value.into(); 179 self 180 } 181 /// Set the `uri` field to an Option value (optional) 182 pub fn maybe_uri( 183 mut self, 184 value: Option<jacquard_common::types::string::AtUri<'a>>, 185 ) -> Self { 186 self.__unsafe_private_named.2 = value; 187 self 188 } 189} 190 191impl<'a, S> AuthorListViewBuilder<'a, S> 192where 193 S: author_list_view_state::State, 194 S::Record: author_list_view_state::IsSet, 195 S::Index: author_list_view_state::IsSet, 196{ 197 /// Build the final struct 198 pub fn build(self) -> AuthorListView<'a> { 199 AuthorListView { 200 index: self.__unsafe_private_named.0.unwrap(), 201 record: self.__unsafe_private_named.1.unwrap(), 202 uri: self.__unsafe_private_named.2, 203 extra_data: Default::default(), 204 } 205 } 206 /// Build the final struct with custom extra_data 207 pub fn build_with_data( 208 self, 209 extra_data: std::collections::BTreeMap< 210 jacquard_common::smol_str::SmolStr, 211 jacquard_common::types::value::Data<'a>, 212 >, 213 ) -> AuthorListView<'a> { 214 AuthorListView { 215 index: self.__unsafe_private_named.0.unwrap(), 216 record: self.__unsafe_private_named.1.unwrap(), 217 uri: self.__unsafe_private_named.2, 218 extra_data: Some(extra_data), 219 } 220 } 221} 222 223fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 224 'static, 225> { 226 ::jacquard_lexicon::lexicon::LexiconDoc { 227 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 228 id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs"), 229 revision: None, 230 description: None, 231 defs: { 232 let mut map = ::alloc::collections::BTreeMap::new(); 233 map.insert( 234 ::jacquard_common::smol_str::SmolStr::new_static("authorListView"), 235 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 236 description: None, 237 required: Some( 238 vec![ 239 ::jacquard_common::smol_str::SmolStr::new_static("record"), 240 ::jacquard_common::smol_str::SmolStr::new_static("index") 241 ], 242 ), 243 nullable: None, 244 properties: { 245 #[allow(unused_mut)] 246 let mut map = ::alloc::collections::BTreeMap::new(); 247 map.insert( 248 ::jacquard_common::smol_str::SmolStr::new_static("index"), 249 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 250 description: None, 251 default: None, 252 minimum: None, 253 maximum: None, 254 r#enum: None, 255 r#const: None, 256 }), 257 ); 258 map.insert( 259 ::jacquard_common::smol_str::SmolStr::new_static("record"), 260 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 261 description: None, 262 r#ref: ::jacquard_common::CowStr::new_static( 263 "sh.weaver.actor.defs#profileDataView", 264 ), 265 }), 266 ); 267 map.insert( 268 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 269 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 270 description: None, 271 format: Some( 272 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 273 ), 274 default: None, 275 min_length: None, 276 max_length: None, 277 min_graphemes: None, 278 max_graphemes: None, 279 r#enum: None, 280 r#const: None, 281 known_values: None, 282 }), 283 ); 284 map 285 }, 286 }), 287 ); 288 map.insert( 289 ::jacquard_common::smol_str::SmolStr::new_static("bookEntryRef"), 290 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 291 description: None, 292 required: Some( 293 vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], 294 ), 295 nullable: None, 296 properties: { 297 #[allow(unused_mut)] 298 let mut map = ::alloc::collections::BTreeMap::new(); 299 map.insert( 300 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 301 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 302 description: None, 303 r#ref: ::jacquard_common::CowStr::new_static("#entryView"), 304 }), 305 ); 306 map 307 }, 308 }), 309 ); 310 map.insert( 311 ::jacquard_common::smol_str::SmolStr::new_static("bookEntryView"), 312 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 313 description: Some( 314 ::jacquard_common::CowStr::new_static( 315 "An ordered entry in a Weaver notebook.", 316 ), 317 ), 318 required: Some( 319 vec![ 320 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 321 ::jacquard_common::smol_str::SmolStr::new_static("index") 322 ], 323 ), 324 nullable: None, 325 properties: { 326 #[allow(unused_mut)] 327 let mut map = ::alloc::collections::BTreeMap::new(); 328 map.insert( 329 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 330 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 331 description: None, 332 r#ref: ::jacquard_common::CowStr::new_static("#entryView"), 333 }), 334 ); 335 map.insert( 336 ::jacquard_common::smol_str::SmolStr::new_static("index"), 337 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 338 description: None, 339 default: None, 340 minimum: None, 341 maximum: None, 342 r#enum: None, 343 r#const: None, 344 }), 345 ); 346 map.insert( 347 ::jacquard_common::smol_str::SmolStr::new_static("next"), 348 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 349 description: None, 350 r#ref: ::jacquard_common::CowStr::new_static( 351 "#bookEntryRef", 352 ), 353 }), 354 ); 355 map.insert( 356 ::jacquard_common::smol_str::SmolStr::new_static("prev"), 357 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 358 description: None, 359 r#ref: ::jacquard_common::CowStr::new_static( 360 "#bookEntryRef", 361 ), 362 }), 363 ); 364 map 365 }, 366 }), 367 ); 368 map.insert( 369 ::jacquard_common::smol_str::SmolStr::new_static("chapterEntryView"), 370 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 371 description: Some( 372 ::jacquard_common::CowStr::new_static( 373 "An entry within a chapter context.", 374 ), 375 ), 376 required: Some( 377 vec![ 378 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 379 ::jacquard_common::smol_str::SmolStr::new_static("index") 380 ], 381 ), 382 nullable: None, 383 properties: { 384 #[allow(unused_mut)] 385 let mut map = ::alloc::collections::BTreeMap::new(); 386 map.insert( 387 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 388 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 389 description: None, 390 r#ref: ::jacquard_common::CowStr::new_static("#entryView"), 391 }), 392 ); 393 map.insert( 394 ::jacquard_common::smol_str::SmolStr::new_static("index"), 395 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 396 description: None, 397 default: None, 398 minimum: None, 399 maximum: None, 400 r#enum: None, 401 r#const: None, 402 }), 403 ); 404 map.insert( 405 ::jacquard_common::smol_str::SmolStr::new_static("next"), 406 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 407 description: None, 408 r#ref: ::jacquard_common::CowStr::new_static( 409 "#bookEntryRef", 410 ), 411 }), 412 ); 413 map.insert( 414 ::jacquard_common::smol_str::SmolStr::new_static("prev"), 415 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 416 description: None, 417 r#ref: ::jacquard_common::CowStr::new_static( 418 "#bookEntryRef", 419 ), 420 }), 421 ); 422 map 423 }, 424 }), 425 ); 426 map.insert( 427 ::jacquard_common::smol_str::SmolStr::new_static("chapterView"), 428 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 429 description: Some( 430 ::jacquard_common::CowStr::new_static( 431 "Hydrated view of a chapter.", 432 ), 433 ), 434 required: Some( 435 vec![ 436 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 437 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 438 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 439 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 440 ::jacquard_common::smol_str::SmolStr::new_static("record"), 441 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 442 ], 443 ), 444 nullable: None, 445 properties: { 446 #[allow(unused_mut)] 447 let mut map = ::alloc::collections::BTreeMap::new(); 448 map.insert( 449 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 450 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 451 description: None, 452 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 453 description: None, 454 r#ref: ::jacquard_common::CowStr::new_static( 455 "#authorListView", 456 ), 457 }), 458 min_length: None, 459 max_length: None, 460 }), 461 ); 462 map.insert( 463 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 464 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 465 description: None, 466 format: Some( 467 ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 468 ), 469 default: None, 470 min_length: None, 471 max_length: None, 472 min_graphemes: None, 473 max_graphemes: None, 474 r#enum: None, 475 r#const: None, 476 known_values: None, 477 }), 478 ); 479 map.insert( 480 ::jacquard_common::smol_str::SmolStr::new_static( 481 "entryCount", 482 ), 483 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 484 description: None, 485 default: None, 486 minimum: None, 487 maximum: None, 488 r#enum: None, 489 r#const: None, 490 }), 491 ); 492 map.insert( 493 ::jacquard_common::smol_str::SmolStr::new_static( 494 "indexedAt", 495 ), 496 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 497 description: None, 498 format: Some( 499 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 500 ), 501 default: None, 502 min_length: None, 503 max_length: None, 504 min_graphemes: None, 505 max_graphemes: None, 506 r#enum: None, 507 r#const: None, 508 known_values: None, 509 }), 510 ); 511 map.insert( 512 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 513 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 514 description: None, 515 r#ref: ::jacquard_common::CowStr::new_static( 516 "#notebookView", 517 ), 518 }), 519 ); 520 map.insert( 521 ::jacquard_common::smol_str::SmolStr::new_static("record"), 522 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 523 description: None, 524 }), 525 ); 526 map.insert( 527 ::jacquard_common::smol_str::SmolStr::new_static("tags"), 528 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 529 description: None, 530 r#ref: ::jacquard_common::CowStr::new_static("#tags"), 531 }), 532 ); 533 map.insert( 534 ::jacquard_common::smol_str::SmolStr::new_static("title"), 535 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 536 description: None, 537 r#ref: ::jacquard_common::CowStr::new_static("#title"), 538 }), 539 ); 540 map.insert( 541 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 542 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 543 description: None, 544 format: Some( 545 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 546 ), 547 default: None, 548 min_length: None, 549 max_length: None, 550 min_graphemes: None, 551 max_graphemes: None, 552 r#enum: None, 553 r#const: None, 554 known_values: None, 555 }), 556 ); 557 map 558 }, 559 }), 560 ); 561 map.insert( 562 ::jacquard_common::smol_str::SmolStr::new_static("contentFormat"), 563 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 564 description: Some( 565 ::jacquard_common::CowStr::new_static( 566 "The format of the content. This is used to determine how to render the content.", 567 ), 568 ), 569 required: None, 570 nullable: None, 571 properties: { 572 #[allow(unused_mut)] 573 let mut map = ::alloc::collections::BTreeMap::new(); 574 map.insert( 575 ::jacquard_common::smol_str::SmolStr::new_static("markdown"), 576 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 577 description: Some( 578 ::jacquard_common::CowStr::new_static( 579 "The format of the content. This is used to determine how to render the content.", 580 ), 581 ), 582 format: None, 583 default: None, 584 min_length: None, 585 max_length: None, 586 min_graphemes: None, 587 max_graphemes: None, 588 r#enum: None, 589 r#const: None, 590 known_values: None, 591 }), 592 ); 593 map 594 }, 595 }), 596 ); 597 map.insert( 598 ::jacquard_common::smol_str::SmolStr::new_static("contentRating"), 599 ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { 600 description: Some( 601 ::jacquard_common::CowStr::new_static( 602 "Author-applied content rating.", 603 ), 604 ), 605 format: None, 606 default: None, 607 min_length: None, 608 max_length: None, 609 min_graphemes: None, 610 max_graphemes: None, 611 r#enum: None, 612 r#const: None, 613 known_values: None, 614 }), 615 ); 616 map.insert( 617 ::jacquard_common::smol_str::SmolStr::new_static("contentWarning"), 618 ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { 619 description: Some( 620 ::jacquard_common::CowStr::new_static( 621 "Author-applied content warning.", 622 ), 623 ), 624 format: None, 625 default: None, 626 min_length: None, 627 max_length: None, 628 min_graphemes: None, 629 max_graphemes: None, 630 r#enum: None, 631 r#const: None, 632 known_values: None, 633 }), 634 ); 635 map.insert( 636 ::jacquard_common::smol_str::SmolStr::new_static("contentWarnings"), 637 ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 638 description: None, 639 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 640 description: None, 641 r#ref: ::jacquard_common::CowStr::new_static("#contentWarning"), 642 }), 643 min_length: None, 644 max_length: Some(10usize), 645 }), 646 ); 647 map.insert( 648 ::jacquard_common::smol_str::SmolStr::new_static("entryView"), 649 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 650 description: None, 651 required: Some( 652 vec![ 653 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 654 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 655 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 656 ::jacquard_common::smol_str::SmolStr::new_static("record"), 657 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 658 ], 659 ), 660 nullable: None, 661 properties: { 662 #[allow(unused_mut)] 663 let mut map = ::alloc::collections::BTreeMap::new(); 664 map.insert( 665 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 666 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 667 description: None, 668 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 669 description: None, 670 r#ref: ::jacquard_common::CowStr::new_static( 671 "#authorListView", 672 ), 673 }), 674 min_length: None, 675 max_length: None, 676 }), 677 ); 678 map.insert( 679 ::jacquard_common::smol_str::SmolStr::new_static( 680 "bookmarkCount", 681 ), 682 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 683 description: None, 684 default: None, 685 minimum: None, 686 maximum: None, 687 r#enum: None, 688 r#const: None, 689 }), 690 ); 691 map.insert( 692 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 693 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 694 description: None, 695 format: Some( 696 ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 697 ), 698 default: None, 699 min_length: None, 700 max_length: None, 701 min_graphemes: None, 702 max_graphemes: None, 703 r#enum: None, 704 r#const: None, 705 known_values: None, 706 }), 707 ); 708 map.insert( 709 ::jacquard_common::smol_str::SmolStr::new_static( 710 "indexedAt", 711 ), 712 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 713 description: None, 714 format: Some( 715 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 716 ), 717 default: None, 718 min_length: None, 719 max_length: None, 720 min_graphemes: None, 721 max_graphemes: None, 722 r#enum: None, 723 r#const: None, 724 known_values: None, 725 }), 726 ); 727 map.insert( 728 ::jacquard_common::smol_str::SmolStr::new_static( 729 "likeCount", 730 ), 731 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 732 description: None, 733 default: None, 734 minimum: None, 735 maximum: None, 736 r#enum: None, 737 r#const: None, 738 }), 739 ); 740 map.insert( 741 ::jacquard_common::smol_str::SmolStr::new_static("path"), 742 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 743 description: None, 744 r#ref: ::jacquard_common::CowStr::new_static("#path"), 745 }), 746 ); 747 map.insert( 748 ::jacquard_common::smol_str::SmolStr::new_static( 749 "permissions", 750 ), 751 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 752 description: None, 753 r#ref: ::jacquard_common::CowStr::new_static( 754 "#permissionsState", 755 ), 756 }), 757 ); 758 map.insert( 759 ::jacquard_common::smol_str::SmolStr::new_static("record"), 760 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 761 description: None, 762 }), 763 ); 764 map.insert( 765 ::jacquard_common::smol_str::SmolStr::new_static( 766 "renderedView", 767 ), 768 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 769 description: None, 770 r#ref: ::jacquard_common::CowStr::new_static( 771 "#renderedView", 772 ), 773 }), 774 ); 775 map.insert( 776 ::jacquard_common::smol_str::SmolStr::new_static("tags"), 777 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 778 description: None, 779 r#ref: ::jacquard_common::CowStr::new_static("#tags"), 780 }), 781 ); 782 map.insert( 783 ::jacquard_common::smol_str::SmolStr::new_static("title"), 784 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 785 description: None, 786 r#ref: ::jacquard_common::CowStr::new_static("#title"), 787 }), 788 ); 789 map.insert( 790 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 791 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 792 description: None, 793 format: Some( 794 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 795 ), 796 default: None, 797 min_length: None, 798 max_length: None, 799 min_graphemes: None, 800 max_graphemes: None, 801 r#enum: None, 802 r#const: None, 803 known_values: None, 804 }), 805 ); 806 map.insert( 807 ::jacquard_common::smol_str::SmolStr::new_static( 808 "viewerBookmark", 809 ), 810 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 811 description: None, 812 format: Some( 813 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 814 ), 815 default: None, 816 min_length: None, 817 max_length: None, 818 min_graphemes: None, 819 max_graphemes: None, 820 r#enum: None, 821 r#const: None, 822 known_values: None, 823 }), 824 ); 825 map.insert( 826 ::jacquard_common::smol_str::SmolStr::new_static( 827 "viewerLike", 828 ), 829 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 830 description: None, 831 format: Some( 832 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 833 ), 834 default: None, 835 min_length: None, 836 max_length: None, 837 min_graphemes: None, 838 max_graphemes: None, 839 r#enum: None, 840 r#const: None, 841 known_values: None, 842 }), 843 ); 844 map.insert( 845 ::jacquard_common::smol_str::SmolStr::new_static( 846 "viewerReadingProgress", 847 ), 848 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 849 description: None, 850 r#ref: ::jacquard_common::CowStr::new_static( 851 "#readingProgress", 852 ), 853 }), 854 ); 855 map 856 }, 857 }), 858 ); 859 map.insert( 860 ::jacquard_common::smol_str::SmolStr::new_static("feedEntryView"), 861 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 862 description: Some( 863 ::jacquard_common::CowStr::new_static( 864 "Entry with feed-specific context (discovery reason, notebook context).", 865 ), 866 ), 867 required: Some( 868 vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], 869 ), 870 nullable: None, 871 properties: { 872 #[allow(unused_mut)] 873 let mut map = ::alloc::collections::BTreeMap::new(); 874 map.insert( 875 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 876 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 877 description: None, 878 r#ref: ::jacquard_common::CowStr::new_static("#entryView"), 879 }), 880 ); 881 map.insert( 882 ::jacquard_common::smol_str::SmolStr::new_static( 883 "notebookContext", 884 ), 885 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 886 description: None, 887 r#ref: ::jacquard_common::CowStr::new_static( 888 "#feedNotebookContext", 889 ), 890 }), 891 ); 892 map.insert( 893 ::jacquard_common::smol_str::SmolStr::new_static("reason"), 894 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 895 description: None, 896 r#ref: ::jacquard_common::CowStr::new_static("#feedReason"), 897 }), 898 ); 899 map 900 }, 901 }), 902 ); 903 map.insert( 904 ::jacquard_common::smol_str::SmolStr::new_static("feedNotebookContext"), 905 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 906 description: Some( 907 ::jacquard_common::CowStr::new_static( 908 "Minimal notebook context for feed display.", 909 ), 910 ), 911 required: Some( 912 vec![ 913 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 914 ::jacquard_common::smol_str::SmolStr::new_static("title") 915 ], 916 ), 917 nullable: None, 918 properties: { 919 #[allow(unused_mut)] 920 let mut map = ::alloc::collections::BTreeMap::new(); 921 map.insert( 922 ::jacquard_common::smol_str::SmolStr::new_static("path"), 923 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 924 description: None, 925 format: None, 926 default: None, 927 min_length: None, 928 max_length: None, 929 min_graphemes: None, 930 max_graphemes: None, 931 r#enum: None, 932 r#const: None, 933 known_values: None, 934 }), 935 ); 936 map.insert( 937 ::jacquard_common::smol_str::SmolStr::new_static("title"), 938 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 939 description: None, 940 format: None, 941 default: None, 942 min_length: None, 943 max_length: None, 944 min_graphemes: None, 945 max_graphemes: None, 946 r#enum: None, 947 r#const: None, 948 known_values: None, 949 }), 950 ); 951 map.insert( 952 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 953 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 954 description: None, 955 format: Some( 956 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 957 ), 958 default: None, 959 min_length: None, 960 max_length: None, 961 min_graphemes: None, 962 max_graphemes: None, 963 r#enum: None, 964 r#const: None, 965 known_values: None, 966 }), 967 ); 968 map 969 }, 970 }), 971 ); 972 map.insert( 973 ::jacquard_common::smol_str::SmolStr::new_static("feedReason"), 974 ::jacquard_lexicon::lexicon::LexUserType::Union(::jacquard_lexicon::lexicon::LexRefUnion { 975 description: None, 976 refs: vec![ 977 ::jacquard_common::CowStr::new_static("#reasonLike"), 978 ::jacquard_common::CowStr::new_static("#reasonBookmark"), 979 ::jacquard_common::CowStr::new_static("#reasonSubscription") 980 ], 981 closed: None, 982 }), 983 ); 984 map.insert( 985 ::jacquard_common::smol_str::SmolStr::new_static("notebookView"), 986 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 987 description: None, 988 required: Some( 989 vec![ 990 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 991 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 992 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 993 ::jacquard_common::smol_str::SmolStr::new_static("record"), 994 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 995 ], 996 ), 997 nullable: None, 998 properties: { 999 #[allow(unused_mut)] 1000 let mut map = ::alloc::collections::BTreeMap::new(); 1001 map.insert( 1002 ::jacquard_common::smol_str::SmolStr::new_static("authors"), 1003 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1004 description: None, 1005 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 1006 description: None, 1007 r#ref: ::jacquard_common::CowStr::new_static( 1008 "#authorListView", 1009 ), 1010 }), 1011 min_length: None, 1012 max_length: None, 1013 }), 1014 ); 1015 map.insert( 1016 ::jacquard_common::smol_str::SmolStr::new_static( 1017 "bookmarkCount", 1018 ), 1019 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1020 description: None, 1021 default: None, 1022 minimum: None, 1023 maximum: None, 1024 r#enum: None, 1025 r#const: None, 1026 }), 1027 ); 1028 map.insert( 1029 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 1030 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1031 description: None, 1032 format: Some( 1033 ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 1034 ), 1035 default: None, 1036 min_length: None, 1037 max_length: None, 1038 min_graphemes: None, 1039 max_graphemes: None, 1040 r#enum: None, 1041 r#const: None, 1042 known_values: None, 1043 }), 1044 ); 1045 map.insert( 1046 ::jacquard_common::smol_str::SmolStr::new_static( 1047 "entryCount", 1048 ), 1049 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1050 description: None, 1051 default: None, 1052 minimum: None, 1053 maximum: None, 1054 r#enum: None, 1055 r#const: None, 1056 }), 1057 ); 1058 map.insert( 1059 ::jacquard_common::smol_str::SmolStr::new_static( 1060 "indexedAt", 1061 ), 1062 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1063 description: None, 1064 format: Some( 1065 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1066 ), 1067 default: None, 1068 min_length: None, 1069 max_length: None, 1070 min_graphemes: None, 1071 max_graphemes: None, 1072 r#enum: None, 1073 r#const: None, 1074 known_values: None, 1075 }), 1076 ); 1077 map.insert( 1078 ::jacquard_common::smol_str::SmolStr::new_static( 1079 "likeCount", 1080 ), 1081 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1082 description: None, 1083 default: None, 1084 minimum: None, 1085 maximum: None, 1086 r#enum: None, 1087 r#const: None, 1088 }), 1089 ); 1090 map.insert( 1091 ::jacquard_common::smol_str::SmolStr::new_static("path"), 1092 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1093 description: None, 1094 r#ref: ::jacquard_common::CowStr::new_static("#path"), 1095 }), 1096 ); 1097 map.insert( 1098 ::jacquard_common::smol_str::SmolStr::new_static( 1099 "permissions", 1100 ), 1101 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1102 description: None, 1103 r#ref: ::jacquard_common::CowStr::new_static( 1104 "#permissionsState", 1105 ), 1106 }), 1107 ); 1108 map.insert( 1109 ::jacquard_common::smol_str::SmolStr::new_static("record"), 1110 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 1111 description: None, 1112 }), 1113 ); 1114 map.insert( 1115 ::jacquard_common::smol_str::SmolStr::new_static( 1116 "subscriberCount", 1117 ), 1118 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1119 description: None, 1120 default: None, 1121 minimum: None, 1122 maximum: None, 1123 r#enum: None, 1124 r#const: None, 1125 }), 1126 ); 1127 map.insert( 1128 ::jacquard_common::smol_str::SmolStr::new_static("tags"), 1129 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1130 description: None, 1131 r#ref: ::jacquard_common::CowStr::new_static("#tags"), 1132 }), 1133 ); 1134 map.insert( 1135 ::jacquard_common::smol_str::SmolStr::new_static("title"), 1136 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1137 description: None, 1138 r#ref: ::jacquard_common::CowStr::new_static("#title"), 1139 }), 1140 ); 1141 map.insert( 1142 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 1143 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1144 description: None, 1145 format: Some( 1146 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1147 ), 1148 default: None, 1149 min_length: None, 1150 max_length: None, 1151 min_graphemes: None, 1152 max_graphemes: None, 1153 r#enum: None, 1154 r#const: None, 1155 known_values: None, 1156 }), 1157 ); 1158 map.insert( 1159 ::jacquard_common::smol_str::SmolStr::new_static( 1160 "viewerBookmark", 1161 ), 1162 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1163 description: None, 1164 format: Some( 1165 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1166 ), 1167 default: None, 1168 min_length: None, 1169 max_length: None, 1170 min_graphemes: None, 1171 max_graphemes: None, 1172 r#enum: None, 1173 r#const: None, 1174 known_values: None, 1175 }), 1176 ); 1177 map.insert( 1178 ::jacquard_common::smol_str::SmolStr::new_static( 1179 "viewerLike", 1180 ), 1181 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1182 description: None, 1183 format: Some( 1184 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1185 ), 1186 default: None, 1187 min_length: None, 1188 max_length: None, 1189 min_graphemes: None, 1190 max_graphemes: None, 1191 r#enum: None, 1192 r#const: None, 1193 known_values: None, 1194 }), 1195 ); 1196 map.insert( 1197 ::jacquard_common::smol_str::SmolStr::new_static( 1198 "viewerReadingProgress", 1199 ), 1200 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1201 description: None, 1202 r#ref: ::jacquard_common::CowStr::new_static( 1203 "#readingProgress", 1204 ), 1205 }), 1206 ); 1207 map.insert( 1208 ::jacquard_common::smol_str::SmolStr::new_static( 1209 "viewerSubscription", 1210 ), 1211 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1212 description: None, 1213 format: Some( 1214 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1215 ), 1216 default: None, 1217 min_length: None, 1218 max_length: None, 1219 min_graphemes: None, 1220 max_graphemes: None, 1221 r#enum: None, 1222 r#const: None, 1223 known_values: None, 1224 }), 1225 ); 1226 map 1227 }, 1228 }), 1229 ); 1230 map.insert( 1231 ::jacquard_common::smol_str::SmolStr::new_static("pageView"), 1232 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1233 description: Some( 1234 ::jacquard_common::CowStr::new_static( 1235 "Hydrated view of a page (entries displayed together).", 1236 ), 1237 ), 1238 required: Some( 1239 vec![ 1240 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 1241 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 1242 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 1243 ::jacquard_common::smol_str::SmolStr::new_static("record"), 1244 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 1245 ], 1246 ), 1247 nullable: None, 1248 properties: { 1249 #[allow(unused_mut)] 1250 let mut map = ::alloc::collections::BTreeMap::new(); 1251 map.insert( 1252 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 1253 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1254 description: None, 1255 format: Some( 1256 ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 1257 ), 1258 default: None, 1259 min_length: None, 1260 max_length: None, 1261 min_graphemes: None, 1262 max_graphemes: None, 1263 r#enum: None, 1264 r#const: None, 1265 known_values: None, 1266 }), 1267 ); 1268 map.insert( 1269 ::jacquard_common::smol_str::SmolStr::new_static( 1270 "entryCount", 1271 ), 1272 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1273 description: None, 1274 default: None, 1275 minimum: None, 1276 maximum: None, 1277 r#enum: None, 1278 r#const: None, 1279 }), 1280 ); 1281 map.insert( 1282 ::jacquard_common::smol_str::SmolStr::new_static( 1283 "indexedAt", 1284 ), 1285 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1286 description: None, 1287 format: Some( 1288 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1289 ), 1290 default: None, 1291 min_length: None, 1292 max_length: None, 1293 min_graphemes: None, 1294 max_graphemes: None, 1295 r#enum: None, 1296 r#const: None, 1297 known_values: None, 1298 }), 1299 ); 1300 map.insert( 1301 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 1302 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1303 description: None, 1304 r#ref: ::jacquard_common::CowStr::new_static( 1305 "#notebookView", 1306 ), 1307 }), 1308 ); 1309 map.insert( 1310 ::jacquard_common::smol_str::SmolStr::new_static("record"), 1311 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 1312 description: None, 1313 }), 1314 ); 1315 map.insert( 1316 ::jacquard_common::smol_str::SmolStr::new_static("tags"), 1317 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1318 description: None, 1319 r#ref: ::jacquard_common::CowStr::new_static("#tags"), 1320 }), 1321 ); 1322 map.insert( 1323 ::jacquard_common::smol_str::SmolStr::new_static("title"), 1324 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1325 description: None, 1326 r#ref: ::jacquard_common::CowStr::new_static("#title"), 1327 }), 1328 ); 1329 map.insert( 1330 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 1331 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1332 description: None, 1333 format: Some( 1334 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1335 ), 1336 default: None, 1337 min_length: None, 1338 max_length: None, 1339 min_graphemes: None, 1340 max_graphemes: None, 1341 r#enum: None, 1342 r#const: None, 1343 known_values: None, 1344 }), 1345 ); 1346 map 1347 }, 1348 }), 1349 ); 1350 map.insert( 1351 ::jacquard_common::smol_str::SmolStr::new_static("path"), 1352 ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { 1353 description: Some( 1354 ::jacquard_common::CowStr::new_static( 1355 "The path of the notebook.", 1356 ), 1357 ), 1358 format: None, 1359 default: None, 1360 min_length: None, 1361 max_length: Some(100usize), 1362 min_graphemes: None, 1363 max_graphemes: None, 1364 r#enum: None, 1365 r#const: None, 1366 known_values: None, 1367 }), 1368 ); 1369 map.insert( 1370 ::jacquard_common::smol_str::SmolStr::new_static("permissionGrant"), 1371 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1372 description: Some( 1373 ::jacquard_common::CowStr::new_static( 1374 "A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt.", 1375 ), 1376 ), 1377 required: Some( 1378 vec![ 1379 ::jacquard_common::smol_str::SmolStr::new_static("did"), 1380 ::jacquard_common::smol_str::SmolStr::new_static("scope"), 1381 ::jacquard_common::smol_str::SmolStr::new_static("source"), 1382 ::jacquard_common::smol_str::SmolStr::new_static("grantedAt") 1383 ], 1384 ), 1385 nullable: None, 1386 properties: { 1387 #[allow(unused_mut)] 1388 let mut map = ::alloc::collections::BTreeMap::new(); 1389 map.insert( 1390 ::jacquard_common::smol_str::SmolStr::new_static("did"), 1391 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1392 description: None, 1393 format: Some( 1394 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 1395 ), 1396 default: None, 1397 min_length: None, 1398 max_length: None, 1399 min_graphemes: None, 1400 max_graphemes: None, 1401 r#enum: None, 1402 r#const: None, 1403 known_values: None, 1404 }), 1405 ); 1406 map.insert( 1407 ::jacquard_common::smol_str::SmolStr::new_static( 1408 "grantedAt", 1409 ), 1410 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1411 description: Some( 1412 ::jacquard_common::CowStr::new_static( 1413 "For authority: record createdAt. For invitees: accept createdAt", 1414 ), 1415 ), 1416 format: Some( 1417 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1418 ), 1419 default: None, 1420 min_length: None, 1421 max_length: None, 1422 min_graphemes: None, 1423 max_graphemes: None, 1424 r#enum: None, 1425 r#const: None, 1426 known_values: None, 1427 }), 1428 ); 1429 map.insert( 1430 ::jacquard_common::smol_str::SmolStr::new_static("scope"), 1431 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1432 description: Some( 1433 ::jacquard_common::CowStr::new_static( 1434 "direct = this resource (includes authority), inherited = via notebook invite", 1435 ), 1436 ), 1437 format: None, 1438 default: None, 1439 min_length: None, 1440 max_length: None, 1441 min_graphemes: None, 1442 max_graphemes: None, 1443 r#enum: None, 1444 r#const: None, 1445 known_values: None, 1446 }), 1447 ); 1448 map.insert( 1449 ::jacquard_common::smol_str::SmolStr::new_static("source"), 1450 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1451 description: Some( 1452 ::jacquard_common::CowStr::new_static( 1453 "For authority: resource URI. For invitees: invite URI", 1454 ), 1455 ), 1456 format: Some( 1457 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1458 ), 1459 default: None, 1460 min_length: None, 1461 max_length: None, 1462 min_graphemes: None, 1463 max_graphemes: None, 1464 r#enum: None, 1465 r#const: None, 1466 known_values: None, 1467 }), 1468 ); 1469 map 1470 }, 1471 }), 1472 ); 1473 map.insert( 1474 ::jacquard_common::smol_str::SmolStr::new_static("permissionsState"), 1475 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1476 description: Some( 1477 ::jacquard_common::CowStr::new_static( 1478 "ACL-style permissions for a resource. Separate from authors (who contributed).", 1479 ), 1480 ), 1481 required: Some( 1482 vec![::jacquard_common::smol_str::SmolStr::new_static("editors")], 1483 ), 1484 nullable: None, 1485 properties: { 1486 #[allow(unused_mut)] 1487 let mut map = ::alloc::collections::BTreeMap::new(); 1488 map.insert( 1489 ::jacquard_common::smol_str::SmolStr::new_static("editors"), 1490 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1491 description: Some( 1492 ::jacquard_common::CowStr::new_static( 1493 "DIDs that can edit this resource", 1494 ), 1495 ), 1496 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 1497 description: None, 1498 r#ref: ::jacquard_common::CowStr::new_static( 1499 "#permissionGrant", 1500 ), 1501 }), 1502 min_length: None, 1503 max_length: None, 1504 }), 1505 ); 1506 map.insert( 1507 ::jacquard_common::smol_str::SmolStr::new_static("viewers"), 1508 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1509 description: Some( 1510 ::jacquard_common::CowStr::new_static( 1511 "DIDs that can view (future use)", 1512 ), 1513 ), 1514 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 1515 description: None, 1516 r#ref: ::jacquard_common::CowStr::new_static( 1517 "#permissionGrant", 1518 ), 1519 }), 1520 min_length: None, 1521 max_length: None, 1522 }), 1523 ); 1524 map 1525 }, 1526 }), 1527 ); 1528 map.insert( 1529 ::jacquard_common::smol_str::SmolStr::new_static("publishedVersionView"), 1530 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1531 description: Some( 1532 ::jacquard_common::CowStr::new_static( 1533 "A published version of an entry in a collaborator's repo.", 1534 ), 1535 ), 1536 required: Some( 1537 vec![ 1538 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 1539 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 1540 ::jacquard_common::smol_str::SmolStr::new_static("publisher"), 1541 ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") 1542 ], 1543 ), 1544 nullable: None, 1545 properties: { 1546 #[allow(unused_mut)] 1547 let mut map = ::alloc::collections::BTreeMap::new(); 1548 map.insert( 1549 ::jacquard_common::smol_str::SmolStr::new_static("cid"), 1550 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1551 description: None, 1552 format: Some( 1553 ::jacquard_lexicon::lexicon::LexStringFormat::Cid, 1554 ), 1555 default: None, 1556 min_length: None, 1557 max_length: None, 1558 min_graphemes: None, 1559 max_graphemes: None, 1560 r#enum: None, 1561 r#const: None, 1562 known_values: None, 1563 }), 1564 ); 1565 map.insert( 1566 ::jacquard_common::smol_str::SmolStr::new_static( 1567 "divergedFrom", 1568 ), 1569 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1570 description: None, 1571 r#ref: ::jacquard_common::CowStr::new_static( 1572 "com.atproto.repo.strongRef", 1573 ), 1574 }), 1575 ); 1576 map.insert( 1577 ::jacquard_common::smol_str::SmolStr::new_static( 1578 "isCanonical", 1579 ), 1580 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 1581 description: None, 1582 default: None, 1583 r#const: None, 1584 }), 1585 ); 1586 map.insert( 1587 ::jacquard_common::smol_str::SmolStr::new_static( 1588 "publishedAt", 1589 ), 1590 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1591 description: None, 1592 format: Some( 1593 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1594 ), 1595 default: None, 1596 min_length: None, 1597 max_length: None, 1598 min_graphemes: None, 1599 max_graphemes: None, 1600 r#enum: None, 1601 r#const: None, 1602 known_values: None, 1603 }), 1604 ); 1605 map.insert( 1606 ::jacquard_common::smol_str::SmolStr::new_static( 1607 "publisher", 1608 ), 1609 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1610 description: None, 1611 r#ref: ::jacquard_common::CowStr::new_static( 1612 "sh.weaver.actor.defs#profileViewBasic", 1613 ), 1614 }), 1615 ); 1616 map.insert( 1617 ::jacquard_common::smol_str::SmolStr::new_static( 1618 "updatedAt", 1619 ), 1620 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1621 description: None, 1622 format: Some( 1623 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1624 ), 1625 default: None, 1626 min_length: None, 1627 max_length: None, 1628 min_graphemes: None, 1629 max_graphemes: None, 1630 r#enum: None, 1631 r#const: None, 1632 known_values: None, 1633 }), 1634 ); 1635 map.insert( 1636 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 1637 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1638 description: None, 1639 format: Some( 1640 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1641 ), 1642 default: None, 1643 min_length: None, 1644 max_length: None, 1645 min_graphemes: None, 1646 max_graphemes: None, 1647 r#enum: None, 1648 r#const: None, 1649 known_values: None, 1650 }), 1651 ); 1652 map 1653 }, 1654 }), 1655 ); 1656 map.insert( 1657 ::jacquard_common::smol_str::SmolStr::new_static("readingProgress"), 1658 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1659 description: Some( 1660 ::jacquard_common::CowStr::new_static( 1661 "Viewer's reading progress (appview-side state, not a record).", 1662 ), 1663 ), 1664 required: None, 1665 nullable: None, 1666 properties: { 1667 #[allow(unused_mut)] 1668 let mut map = ::alloc::collections::BTreeMap::new(); 1669 map.insert( 1670 ::jacquard_common::smol_str::SmolStr::new_static( 1671 "currentEntry", 1672 ), 1673 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1674 description: Some( 1675 ::jacquard_common::CowStr::new_static( 1676 "Last entry the viewer was reading.", 1677 ), 1678 ), 1679 format: Some( 1680 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1681 ), 1682 default: None, 1683 min_length: None, 1684 max_length: None, 1685 min_graphemes: None, 1686 max_graphemes: None, 1687 r#enum: None, 1688 r#const: None, 1689 known_values: None, 1690 }), 1691 ); 1692 map.insert( 1693 ::jacquard_common::smol_str::SmolStr::new_static( 1694 "finishedAt", 1695 ), 1696 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1697 description: None, 1698 format: Some( 1699 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1700 ), 1701 default: None, 1702 min_length: None, 1703 max_length: None, 1704 min_graphemes: None, 1705 max_graphemes: None, 1706 r#enum: None, 1707 r#const: None, 1708 known_values: None, 1709 }), 1710 ); 1711 map.insert( 1712 ::jacquard_common::smol_str::SmolStr::new_static( 1713 "lastReadAt", 1714 ), 1715 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1716 description: None, 1717 format: Some( 1718 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1719 ), 1720 default: None, 1721 min_length: None, 1722 max_length: None, 1723 min_graphemes: None, 1724 max_graphemes: None, 1725 r#enum: None, 1726 r#const: None, 1727 known_values: None, 1728 }), 1729 ); 1730 map.insert( 1731 ::jacquard_common::smol_str::SmolStr::new_static( 1732 "percentComplete", 1733 ), 1734 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1735 description: None, 1736 default: None, 1737 minimum: Some(0i64), 1738 maximum: Some(100i64), 1739 r#enum: None, 1740 r#const: None, 1741 }), 1742 ); 1743 map.insert( 1744 ::jacquard_common::smol_str::SmolStr::new_static( 1745 "startedAt", 1746 ), 1747 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1748 description: None, 1749 format: Some( 1750 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1751 ), 1752 default: None, 1753 min_length: None, 1754 max_length: None, 1755 min_graphemes: None, 1756 max_graphemes: None, 1757 r#enum: None, 1758 r#const: None, 1759 known_values: None, 1760 }), 1761 ); 1762 map.insert( 1763 ::jacquard_common::smol_str::SmolStr::new_static("status"), 1764 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1765 description: None, 1766 format: None, 1767 default: None, 1768 min_length: None, 1769 max_length: None, 1770 min_graphemes: None, 1771 max_graphemes: None, 1772 r#enum: None, 1773 r#const: None, 1774 known_values: None, 1775 }), 1776 ); 1777 map 1778 }, 1779 }), 1780 ); 1781 map.insert( 1782 ::jacquard_common::smol_str::SmolStr::new_static("reasonBookmark"), 1783 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1784 description: None, 1785 required: Some( 1786 vec![ 1787 ::jacquard_common::smol_str::SmolStr::new_static("by"), 1788 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 1789 ], 1790 ), 1791 nullable: None, 1792 properties: { 1793 #[allow(unused_mut)] 1794 let mut map = ::alloc::collections::BTreeMap::new(); 1795 map.insert( 1796 ::jacquard_common::smol_str::SmolStr::new_static("by"), 1797 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1798 description: None, 1799 r#ref: ::jacquard_common::CowStr::new_static( 1800 "sh.weaver.actor.defs#profileViewBasic", 1801 ), 1802 }), 1803 ); 1804 map.insert( 1805 ::jacquard_common::smol_str::SmolStr::new_static( 1806 "indexedAt", 1807 ), 1808 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1809 description: None, 1810 format: Some( 1811 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1812 ), 1813 default: None, 1814 min_length: None, 1815 max_length: None, 1816 min_graphemes: None, 1817 max_graphemes: None, 1818 r#enum: None, 1819 r#const: None, 1820 known_values: None, 1821 }), 1822 ); 1823 map 1824 }, 1825 }), 1826 ); 1827 map.insert( 1828 ::jacquard_common::smol_str::SmolStr::new_static("reasonLike"), 1829 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1830 description: None, 1831 required: Some( 1832 vec![ 1833 ::jacquard_common::smol_str::SmolStr::new_static("by"), 1834 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 1835 ], 1836 ), 1837 nullable: None, 1838 properties: { 1839 #[allow(unused_mut)] 1840 let mut map = ::alloc::collections::BTreeMap::new(); 1841 map.insert( 1842 ::jacquard_common::smol_str::SmolStr::new_static("by"), 1843 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 1844 description: None, 1845 r#ref: ::jacquard_common::CowStr::new_static( 1846 "sh.weaver.actor.defs#profileViewBasic", 1847 ), 1848 }), 1849 ); 1850 map.insert( 1851 ::jacquard_common::smol_str::SmolStr::new_static( 1852 "indexedAt", 1853 ), 1854 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1855 description: None, 1856 format: Some( 1857 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1858 ), 1859 default: None, 1860 min_length: None, 1861 max_length: None, 1862 min_graphemes: None, 1863 max_graphemes: None, 1864 r#enum: None, 1865 r#const: None, 1866 known_values: None, 1867 }), 1868 ); 1869 map 1870 }, 1871 }), 1872 ); 1873 map.insert( 1874 ::jacquard_common::smol_str::SmolStr::new_static("reasonSubscription"), 1875 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1876 description: None, 1877 required: Some( 1878 vec![ 1879 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") 1880 ], 1881 ), 1882 nullable: None, 1883 properties: { 1884 #[allow(unused_mut)] 1885 let mut map = ::alloc::collections::BTreeMap::new(); 1886 map.insert( 1887 ::jacquard_common::smol_str::SmolStr::new_static( 1888 "indexedAt", 1889 ), 1890 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1891 description: None, 1892 format: Some( 1893 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1894 ), 1895 default: None, 1896 min_length: None, 1897 max_length: None, 1898 min_graphemes: None, 1899 max_graphemes: None, 1900 r#enum: None, 1901 r#const: None, 1902 known_values: None, 1903 }), 1904 ); 1905 map 1906 }, 1907 }), 1908 ); 1909 map.insert( 1910 ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), 1911 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1912 description: Some( 1913 ::jacquard_common::CowStr::new_static( 1914 "View of a rendered and cached notebook entry", 1915 ), 1916 ), 1917 required: Some( 1918 vec![::jacquard_common::smol_str::SmolStr::new_static("html")], 1919 ), 1920 nullable: None, 1921 properties: { 1922 #[allow(unused_mut)] 1923 let mut map = ::alloc::collections::BTreeMap::new(); 1924 map.insert( 1925 ::jacquard_common::smol_str::SmolStr::new_static("css"), 1926 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 1927 description: None, 1928 accept: None, 1929 max_size: None, 1930 }), 1931 ); 1932 map.insert( 1933 ::jacquard_common::smol_str::SmolStr::new_static("html"), 1934 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 1935 description: None, 1936 accept: None, 1937 max_size: None, 1938 }), 1939 ); 1940 map 1941 }, 1942 }), 1943 ); 1944 map.insert( 1945 ::jacquard_common::smol_str::SmolStr::new_static("tags"), 1946 ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 1947 description: None, 1948 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 1949 description: None, 1950 format: None, 1951 default: None, 1952 min_length: None, 1953 max_length: Some(64usize), 1954 min_graphemes: None, 1955 max_graphemes: None, 1956 r#enum: None, 1957 r#const: None, 1958 known_values: None, 1959 }), 1960 min_length: None, 1961 max_length: Some(10usize), 1962 }), 1963 ); 1964 map.insert( 1965 ::jacquard_common::smol_str::SmolStr::new_static("title"), 1966 ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { 1967 description: Some( 1968 ::jacquard_common::CowStr::new_static( 1969 "The title of the notebook entry.", 1970 ), 1971 ), 1972 format: None, 1973 default: None, 1974 min_length: None, 1975 max_length: Some(300usize), 1976 min_graphemes: None, 1977 max_graphemes: None, 1978 r#enum: None, 1979 r#const: None, 1980 known_values: None, 1981 }), 1982 ); 1983 map 1984 }, 1985 } 1986} 1987 1988impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> { 1989 fn nsid() -> &'static str { 1990 "sh.weaver.notebook.defs" 1991 } 1992 fn def_name() -> &'static str { 1993 "authorListView" 1994 } 1995 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1996 lexicon_doc_sh_weaver_notebook_defs() 1997 } 1998 fn validate( 1999 &self, 2000 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2001 Ok(()) 2002 } 2003} 2004 2005#[jacquard_derive::lexicon] 2006#[derive( 2007 serde::Serialize, 2008 serde::Deserialize, 2009 Debug, 2010 Clone, 2011 PartialEq, 2012 Eq, 2013 jacquard_derive::IntoStatic 2014)] 2015#[serde(rename_all = "camelCase")] 2016pub struct BookEntryRef<'a> { 2017 #[serde(borrow)] 2018 pub entry: crate::sh_weaver::notebook::EntryView<'a>, 2019} 2020 2021pub mod book_entry_ref_state { 2022 2023 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2024 #[allow(unused)] 2025 use ::core::marker::PhantomData; 2026 mod sealed { 2027 pub trait Sealed {} 2028 } 2029 /// State trait tracking which required fields have been set 2030 pub trait State: sealed::Sealed { 2031 type Entry; 2032 } 2033 /// Empty state - all required fields are unset 2034 pub struct Empty(()); 2035 impl sealed::Sealed for Empty {} 2036 impl State for Empty { 2037 type Entry = Unset; 2038 } 2039 ///State transition - sets the `entry` field to Set 2040 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2041 impl<S: State> sealed::Sealed for SetEntry<S> {} 2042 impl<S: State> State for SetEntry<S> { 2043 type Entry = Set<members::entry>; 2044 } 2045 /// Marker types for field names 2046 #[allow(non_camel_case_types)] 2047 pub mod members { 2048 ///Marker type for the `entry` field 2049 pub struct entry(()); 2050 } 2051} 2052 2053/// Builder for constructing an instance of this type 2054pub struct BookEntryRefBuilder<'a, S: book_entry_ref_state::State> { 2055 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2056 __unsafe_private_named: ( 2057 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>, 2058 ), 2059 _phantom: ::core::marker::PhantomData<&'a ()>, 2060} 2061 2062impl<'a> BookEntryRef<'a> { 2063 /// Create a new builder for this type 2064 pub fn new() -> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { 2065 BookEntryRefBuilder::new() 2066 } 2067} 2068 2069impl<'a> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { 2070 /// Create a new builder with all fields unset 2071 pub fn new() -> Self { 2072 BookEntryRefBuilder { 2073 _phantom_state: ::core::marker::PhantomData, 2074 __unsafe_private_named: (None,), 2075 _phantom: ::core::marker::PhantomData, 2076 } 2077 } 2078} 2079 2080impl<'a, S> BookEntryRefBuilder<'a, S> 2081where 2082 S: book_entry_ref_state::State, 2083 S::Entry: book_entry_ref_state::IsUnset, 2084{ 2085 /// Set the `entry` field (required) 2086 pub fn entry( 2087 mut self, 2088 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>, 2089 ) -> BookEntryRefBuilder<'a, book_entry_ref_state::SetEntry<S>> { 2090 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 2091 BookEntryRefBuilder { 2092 _phantom_state: ::core::marker::PhantomData, 2093 __unsafe_private_named: self.__unsafe_private_named, 2094 _phantom: ::core::marker::PhantomData, 2095 } 2096 } 2097} 2098 2099impl<'a, S> BookEntryRefBuilder<'a, S> 2100where 2101 S: book_entry_ref_state::State, 2102 S::Entry: book_entry_ref_state::IsSet, 2103{ 2104 /// Build the final struct 2105 pub fn build(self) -> BookEntryRef<'a> { 2106 BookEntryRef { 2107 entry: self.__unsafe_private_named.0.unwrap(), 2108 extra_data: Default::default(), 2109 } 2110 } 2111 /// Build the final struct with custom extra_data 2112 pub fn build_with_data( 2113 self, 2114 extra_data: std::collections::BTreeMap< 2115 jacquard_common::smol_str::SmolStr, 2116 jacquard_common::types::value::Data<'a>, 2117 >, 2118 ) -> BookEntryRef<'a> { 2119 BookEntryRef { 2120 entry: self.__unsafe_private_named.0.unwrap(), 2121 extra_data: Some(extra_data), 2122 } 2123 } 2124} 2125 2126impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> { 2127 fn nsid() -> &'static str { 2128 "sh.weaver.notebook.defs" 2129 } 2130 fn def_name() -> &'static str { 2131 "bookEntryRef" 2132 } 2133 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2134 lexicon_doc_sh_weaver_notebook_defs() 2135 } 2136 fn validate( 2137 &self, 2138 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2139 Ok(()) 2140 } 2141} 2142 2143/// An ordered entry in a Weaver notebook. 2144#[jacquard_derive::lexicon] 2145#[derive( 2146 serde::Serialize, 2147 serde::Deserialize, 2148 Debug, 2149 Clone, 2150 PartialEq, 2151 Eq, 2152 jacquard_derive::IntoStatic 2153)] 2154#[serde(rename_all = "camelCase")] 2155pub struct BookEntryView<'a> { 2156 #[serde(borrow)] 2157 pub entry: crate::sh_weaver::notebook::EntryView<'a>, 2158 pub index: i64, 2159 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2160 #[serde(borrow)] 2161 pub next: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2162 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2163 #[serde(borrow)] 2164 pub prev: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2165} 2166 2167pub mod book_entry_view_state { 2168 2169 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2170 #[allow(unused)] 2171 use ::core::marker::PhantomData; 2172 mod sealed { 2173 pub trait Sealed {} 2174 } 2175 /// State trait tracking which required fields have been set 2176 pub trait State: sealed::Sealed { 2177 type Entry; 2178 type Index; 2179 } 2180 /// Empty state - all required fields are unset 2181 pub struct Empty(()); 2182 impl sealed::Sealed for Empty {} 2183 impl State for Empty { 2184 type Entry = Unset; 2185 type Index = Unset; 2186 } 2187 ///State transition - sets the `entry` field to Set 2188 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2189 impl<S: State> sealed::Sealed for SetEntry<S> {} 2190 impl<S: State> State for SetEntry<S> { 2191 type Entry = Set<members::entry>; 2192 type Index = S::Index; 2193 } 2194 ///State transition - sets the `index` field to Set 2195 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2196 impl<S: State> sealed::Sealed for SetIndex<S> {} 2197 impl<S: State> State for SetIndex<S> { 2198 type Entry = S::Entry; 2199 type Index = Set<members::index>; 2200 } 2201 /// Marker types for field names 2202 #[allow(non_camel_case_types)] 2203 pub mod members { 2204 ///Marker type for the `entry` field 2205 pub struct entry(()); 2206 ///Marker type for the `index` field 2207 pub struct index(()); 2208 } 2209} 2210 2211/// Builder for constructing an instance of this type 2212pub struct BookEntryViewBuilder<'a, S: book_entry_view_state::State> { 2213 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2214 __unsafe_private_named: ( 2215 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>, 2216 ::core::option::Option<i64>, 2217 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2218 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2219 ), 2220 _phantom: ::core::marker::PhantomData<&'a ()>, 2221} 2222 2223impl<'a> BookEntryView<'a> { 2224 /// Create a new builder for this type 2225 pub fn new() -> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { 2226 BookEntryViewBuilder::new() 2227 } 2228} 2229 2230impl<'a> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { 2231 /// Create a new builder with all fields unset 2232 pub fn new() -> Self { 2233 BookEntryViewBuilder { 2234 _phantom_state: ::core::marker::PhantomData, 2235 __unsafe_private_named: (None, None, None, None), 2236 _phantom: ::core::marker::PhantomData, 2237 } 2238 } 2239} 2240 2241impl<'a, S> BookEntryViewBuilder<'a, S> 2242where 2243 S: book_entry_view_state::State, 2244 S::Entry: book_entry_view_state::IsUnset, 2245{ 2246 /// Set the `entry` field (required) 2247 pub fn entry( 2248 mut self, 2249 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>, 2250 ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetEntry<S>> { 2251 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 2252 BookEntryViewBuilder { 2253 _phantom_state: ::core::marker::PhantomData, 2254 __unsafe_private_named: self.__unsafe_private_named, 2255 _phantom: ::core::marker::PhantomData, 2256 } 2257 } 2258} 2259 2260impl<'a, S> BookEntryViewBuilder<'a, S> 2261where 2262 S: book_entry_view_state::State, 2263 S::Index: book_entry_view_state::IsUnset, 2264{ 2265 /// Set the `index` field (required) 2266 pub fn index( 2267 mut self, 2268 value: impl Into<i64>, 2269 ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetIndex<S>> { 2270 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 2271 BookEntryViewBuilder { 2272 _phantom_state: ::core::marker::PhantomData, 2273 __unsafe_private_named: self.__unsafe_private_named, 2274 _phantom: ::core::marker::PhantomData, 2275 } 2276 } 2277} 2278 2279impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { 2280 /// Set the `next` field (optional) 2281 pub fn next( 2282 mut self, 2283 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>, 2284 ) -> Self { 2285 self.__unsafe_private_named.2 = value.into(); 2286 self 2287 } 2288 /// Set the `next` field to an Option value (optional) 2289 pub fn maybe_next( 2290 mut self, 2291 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2292 ) -> Self { 2293 self.__unsafe_private_named.2 = value; 2294 self 2295 } 2296} 2297 2298impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { 2299 /// Set the `prev` field (optional) 2300 pub fn prev( 2301 mut self, 2302 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>, 2303 ) -> Self { 2304 self.__unsafe_private_named.3 = value.into(); 2305 self 2306 } 2307 /// Set the `prev` field to an Option value (optional) 2308 pub fn maybe_prev( 2309 mut self, 2310 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2311 ) -> Self { 2312 self.__unsafe_private_named.3 = value; 2313 self 2314 } 2315} 2316 2317impl<'a, S> BookEntryViewBuilder<'a, S> 2318where 2319 S: book_entry_view_state::State, 2320 S::Entry: book_entry_view_state::IsSet, 2321 S::Index: book_entry_view_state::IsSet, 2322{ 2323 /// Build the final struct 2324 pub fn build(self) -> BookEntryView<'a> { 2325 BookEntryView { 2326 entry: self.__unsafe_private_named.0.unwrap(), 2327 index: self.__unsafe_private_named.1.unwrap(), 2328 next: self.__unsafe_private_named.2, 2329 prev: self.__unsafe_private_named.3, 2330 extra_data: Default::default(), 2331 } 2332 } 2333 /// Build the final struct with custom extra_data 2334 pub fn build_with_data( 2335 self, 2336 extra_data: std::collections::BTreeMap< 2337 jacquard_common::smol_str::SmolStr, 2338 jacquard_common::types::value::Data<'a>, 2339 >, 2340 ) -> BookEntryView<'a> { 2341 BookEntryView { 2342 entry: self.__unsafe_private_named.0.unwrap(), 2343 index: self.__unsafe_private_named.1.unwrap(), 2344 next: self.__unsafe_private_named.2, 2345 prev: self.__unsafe_private_named.3, 2346 extra_data: Some(extra_data), 2347 } 2348 } 2349} 2350 2351impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryView<'a> { 2352 fn nsid() -> &'static str { 2353 "sh.weaver.notebook.defs" 2354 } 2355 fn def_name() -> &'static str { 2356 "bookEntryView" 2357 } 2358 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2359 lexicon_doc_sh_weaver_notebook_defs() 2360 } 2361 fn validate( 2362 &self, 2363 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2364 Ok(()) 2365 } 2366} 2367 2368/// An entry within a chapter context. 2369#[jacquard_derive::lexicon] 2370#[derive( 2371 serde::Serialize, 2372 serde::Deserialize, 2373 Debug, 2374 Clone, 2375 PartialEq, 2376 Eq, 2377 jacquard_derive::IntoStatic 2378)] 2379#[serde(rename_all = "camelCase")] 2380pub struct ChapterEntryView<'a> { 2381 #[serde(borrow)] 2382 pub entry: crate::sh_weaver::notebook::EntryView<'a>, 2383 pub index: i64, 2384 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2385 #[serde(borrow)] 2386 pub next: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2387 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2388 #[serde(borrow)] 2389 pub prev: std::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2390} 2391 2392pub mod chapter_entry_view_state { 2393 2394 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2395 #[allow(unused)] 2396 use ::core::marker::PhantomData; 2397 mod sealed { 2398 pub trait Sealed {} 2399 } 2400 /// State trait tracking which required fields have been set 2401 pub trait State: sealed::Sealed { 2402 type Index; 2403 type Entry; 2404 } 2405 /// Empty state - all required fields are unset 2406 pub struct Empty(()); 2407 impl sealed::Sealed for Empty {} 2408 impl State for Empty { 2409 type Index = Unset; 2410 type Entry = Unset; 2411 } 2412 ///State transition - sets the `index` field to Set 2413 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 2414 impl<S: State> sealed::Sealed for SetIndex<S> {} 2415 impl<S: State> State for SetIndex<S> { 2416 type Index = Set<members::index>; 2417 type Entry = S::Entry; 2418 } 2419 ///State transition - sets the `entry` field to Set 2420 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 2421 impl<S: State> sealed::Sealed for SetEntry<S> {} 2422 impl<S: State> State for SetEntry<S> { 2423 type Index = S::Index; 2424 type Entry = Set<members::entry>; 2425 } 2426 /// Marker types for field names 2427 #[allow(non_camel_case_types)] 2428 pub mod members { 2429 ///Marker type for the `index` field 2430 pub struct index(()); 2431 ///Marker type for the `entry` field 2432 pub struct entry(()); 2433 } 2434} 2435 2436/// Builder for constructing an instance of this type 2437pub struct ChapterEntryViewBuilder<'a, S: chapter_entry_view_state::State> { 2438 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2439 __unsafe_private_named: ( 2440 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>, 2441 ::core::option::Option<i64>, 2442 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2443 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2444 ), 2445 _phantom: ::core::marker::PhantomData<&'a ()>, 2446} 2447 2448impl<'a> ChapterEntryView<'a> { 2449 /// Create a new builder for this type 2450 pub fn new() -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { 2451 ChapterEntryViewBuilder::new() 2452 } 2453} 2454 2455impl<'a> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { 2456 /// Create a new builder with all fields unset 2457 pub fn new() -> Self { 2458 ChapterEntryViewBuilder { 2459 _phantom_state: ::core::marker::PhantomData, 2460 __unsafe_private_named: (None, None, None, None), 2461 _phantom: ::core::marker::PhantomData, 2462 } 2463 } 2464} 2465 2466impl<'a, S> ChapterEntryViewBuilder<'a, S> 2467where 2468 S: chapter_entry_view_state::State, 2469 S::Entry: chapter_entry_view_state::IsUnset, 2470{ 2471 /// Set the `entry` field (required) 2472 pub fn entry( 2473 mut self, 2474 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>, 2475 ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetEntry<S>> { 2476 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 2477 ChapterEntryViewBuilder { 2478 _phantom_state: ::core::marker::PhantomData, 2479 __unsafe_private_named: self.__unsafe_private_named, 2480 _phantom: ::core::marker::PhantomData, 2481 } 2482 } 2483} 2484 2485impl<'a, S> ChapterEntryViewBuilder<'a, S> 2486where 2487 S: chapter_entry_view_state::State, 2488 S::Index: chapter_entry_view_state::IsUnset, 2489{ 2490 /// Set the `index` field (required) 2491 pub fn index( 2492 mut self, 2493 value: impl Into<i64>, 2494 ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetIndex<S>> { 2495 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 2496 ChapterEntryViewBuilder { 2497 _phantom_state: ::core::marker::PhantomData, 2498 __unsafe_private_named: self.__unsafe_private_named, 2499 _phantom: ::core::marker::PhantomData, 2500 } 2501 } 2502} 2503 2504impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { 2505 /// Set the `next` field (optional) 2506 pub fn next( 2507 mut self, 2508 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>, 2509 ) -> Self { 2510 self.__unsafe_private_named.2 = value.into(); 2511 self 2512 } 2513 /// Set the `next` field to an Option value (optional) 2514 pub fn maybe_next( 2515 mut self, 2516 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2517 ) -> Self { 2518 self.__unsafe_private_named.2 = value; 2519 self 2520 } 2521} 2522 2523impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { 2524 /// Set the `prev` field (optional) 2525 pub fn prev( 2526 mut self, 2527 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>, 2528 ) -> Self { 2529 self.__unsafe_private_named.3 = value.into(); 2530 self 2531 } 2532 /// Set the `prev` field to an Option value (optional) 2533 pub fn maybe_prev( 2534 mut self, 2535 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>, 2536 ) -> Self { 2537 self.__unsafe_private_named.3 = value; 2538 self 2539 } 2540} 2541 2542impl<'a, S> ChapterEntryViewBuilder<'a, S> 2543where 2544 S: chapter_entry_view_state::State, 2545 S::Index: chapter_entry_view_state::IsSet, 2546 S::Entry: chapter_entry_view_state::IsSet, 2547{ 2548 /// Build the final struct 2549 pub fn build(self) -> ChapterEntryView<'a> { 2550 ChapterEntryView { 2551 entry: self.__unsafe_private_named.0.unwrap(), 2552 index: self.__unsafe_private_named.1.unwrap(), 2553 next: self.__unsafe_private_named.2, 2554 prev: self.__unsafe_private_named.3, 2555 extra_data: Default::default(), 2556 } 2557 } 2558 /// Build the final struct with custom extra_data 2559 pub fn build_with_data( 2560 self, 2561 extra_data: std::collections::BTreeMap< 2562 jacquard_common::smol_str::SmolStr, 2563 jacquard_common::types::value::Data<'a>, 2564 >, 2565 ) -> ChapterEntryView<'a> { 2566 ChapterEntryView { 2567 entry: self.__unsafe_private_named.0.unwrap(), 2568 index: self.__unsafe_private_named.1.unwrap(), 2569 next: self.__unsafe_private_named.2, 2570 prev: self.__unsafe_private_named.3, 2571 extra_data: Some(extra_data), 2572 } 2573 } 2574} 2575 2576impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterEntryView<'a> { 2577 fn nsid() -> &'static str { 2578 "sh.weaver.notebook.defs" 2579 } 2580 fn def_name() -> &'static str { 2581 "chapterEntryView" 2582 } 2583 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2584 lexicon_doc_sh_weaver_notebook_defs() 2585 } 2586 fn validate( 2587 &self, 2588 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2589 Ok(()) 2590 } 2591} 2592 2593/// Hydrated view of a chapter. 2594#[jacquard_derive::lexicon] 2595#[derive( 2596 serde::Serialize, 2597 serde::Deserialize, 2598 Debug, 2599 Clone, 2600 PartialEq, 2601 Eq, 2602 jacquard_derive::IntoStatic 2603)] 2604#[serde(rename_all = "camelCase")] 2605pub struct ChapterView<'a> { 2606 #[serde(borrow)] 2607 pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>, 2608 #[serde(borrow)] 2609 pub cid: jacquard_common::types::string::Cid<'a>, 2610 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2611 pub entry_count: std::option::Option<i64>, 2612 pub indexed_at: jacquard_common::types::string::Datetime, 2613 #[serde(borrow)] 2614 pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, 2615 #[serde(borrow)] 2616 pub record: jacquard_common::types::value::Data<'a>, 2617 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2618 #[serde(borrow)] 2619 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 2620 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2621 #[serde(borrow)] 2622 pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>, 2623 #[serde(borrow)] 2624 pub uri: jacquard_common::types::string::AtUri<'a>, 2625} 2626 2627pub mod chapter_view_state { 2628 2629 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2630 #[allow(unused)] 2631 use ::core::marker::PhantomData; 2632 mod sealed { 2633 pub trait Sealed {} 2634 } 2635 /// State trait tracking which required fields have been set 2636 pub trait State: sealed::Sealed { 2637 type Record; 2638 type IndexedAt; 2639 type Authors; 2640 type Notebook; 2641 type Cid; 2642 type Uri; 2643 } 2644 /// Empty state - all required fields are unset 2645 pub struct Empty(()); 2646 impl sealed::Sealed for Empty {} 2647 impl State for Empty { 2648 type Record = Unset; 2649 type IndexedAt = Unset; 2650 type Authors = Unset; 2651 type Notebook = Unset; 2652 type Cid = Unset; 2653 type Uri = Unset; 2654 } 2655 ///State transition - sets the `record` field to Set 2656 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 2657 impl<S: State> sealed::Sealed for SetRecord<S> {} 2658 impl<S: State> State for SetRecord<S> { 2659 type Record = Set<members::record>; 2660 type IndexedAt = S::IndexedAt; 2661 type Authors = S::Authors; 2662 type Notebook = S::Notebook; 2663 type Cid = S::Cid; 2664 type Uri = S::Uri; 2665 } 2666 ///State transition - sets the `indexed_at` field to Set 2667 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 2668 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 2669 impl<S: State> State for SetIndexedAt<S> { 2670 type Record = S::Record; 2671 type IndexedAt = Set<members::indexed_at>; 2672 type Authors = S::Authors; 2673 type Notebook = S::Notebook; 2674 type Cid = S::Cid; 2675 type Uri = S::Uri; 2676 } 2677 ///State transition - sets the `authors` field to Set 2678 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 2679 impl<S: State> sealed::Sealed for SetAuthors<S> {} 2680 impl<S: State> State for SetAuthors<S> { 2681 type Record = S::Record; 2682 type IndexedAt = S::IndexedAt; 2683 type Authors = Set<members::authors>; 2684 type Notebook = S::Notebook; 2685 type Cid = S::Cid; 2686 type Uri = S::Uri; 2687 } 2688 ///State transition - sets the `notebook` field to Set 2689 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 2690 impl<S: State> sealed::Sealed for SetNotebook<S> {} 2691 impl<S: State> State for SetNotebook<S> { 2692 type Record = S::Record; 2693 type IndexedAt = S::IndexedAt; 2694 type Authors = S::Authors; 2695 type Notebook = Set<members::notebook>; 2696 type Cid = S::Cid; 2697 type Uri = S::Uri; 2698 } 2699 ///State transition - sets the `cid` field to Set 2700 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 2701 impl<S: State> sealed::Sealed for SetCid<S> {} 2702 impl<S: State> State for SetCid<S> { 2703 type Record = S::Record; 2704 type IndexedAt = S::IndexedAt; 2705 type Authors = S::Authors; 2706 type Notebook = S::Notebook; 2707 type Cid = Set<members::cid>; 2708 type Uri = S::Uri; 2709 } 2710 ///State transition - sets the `uri` field to Set 2711 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2712 impl<S: State> sealed::Sealed for SetUri<S> {} 2713 impl<S: State> State for SetUri<S> { 2714 type Record = S::Record; 2715 type IndexedAt = S::IndexedAt; 2716 type Authors = S::Authors; 2717 type Notebook = S::Notebook; 2718 type Cid = S::Cid; 2719 type Uri = Set<members::uri>; 2720 } 2721 /// Marker types for field names 2722 #[allow(non_camel_case_types)] 2723 pub mod members { 2724 ///Marker type for the `record` field 2725 pub struct record(()); 2726 ///Marker type for the `indexed_at` field 2727 pub struct indexed_at(()); 2728 ///Marker type for the `authors` field 2729 pub struct authors(()); 2730 ///Marker type for the `notebook` field 2731 pub struct notebook(()); 2732 ///Marker type for the `cid` field 2733 pub struct cid(()); 2734 ///Marker type for the `uri` field 2735 pub struct uri(()); 2736 } 2737} 2738 2739/// Builder for constructing an instance of this type 2740pub struct ChapterViewBuilder<'a, S: chapter_view_state::State> { 2741 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2742 __unsafe_private_named: ( 2743 ::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 2744 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 2745 ::core::option::Option<i64>, 2746 ::core::option::Option<jacquard_common::types::string::Datetime>, 2747 ::core::option::Option<crate::sh_weaver::notebook::NotebookView<'a>>, 2748 ::core::option::Option<jacquard_common::types::value::Data<'a>>, 2749 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 2750 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>, 2751 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 2752 ), 2753 _phantom: ::core::marker::PhantomData<&'a ()>, 2754} 2755 2756impl<'a> ChapterView<'a> { 2757 /// Create a new builder for this type 2758 pub fn new() -> ChapterViewBuilder<'a, chapter_view_state::Empty> { 2759 ChapterViewBuilder::new() 2760 } 2761} 2762 2763impl<'a> ChapterViewBuilder<'a, chapter_view_state::Empty> { 2764 /// Create a new builder with all fields unset 2765 pub fn new() -> Self { 2766 ChapterViewBuilder { 2767 _phantom_state: ::core::marker::PhantomData, 2768 __unsafe_private_named: ( 2769 None, 2770 None, 2771 None, 2772 None, 2773 None, 2774 None, 2775 None, 2776 None, 2777 None, 2778 ), 2779 _phantom: ::core::marker::PhantomData, 2780 } 2781 } 2782} 2783 2784impl<'a, S> ChapterViewBuilder<'a, S> 2785where 2786 S: chapter_view_state::State, 2787 S::Authors: chapter_view_state::IsUnset, 2788{ 2789 /// Set the `authors` field (required) 2790 pub fn authors( 2791 mut self, 2792 value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 2793 ) -> ChapterViewBuilder<'a, chapter_view_state::SetAuthors<S>> { 2794 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 2795 ChapterViewBuilder { 2796 _phantom_state: ::core::marker::PhantomData, 2797 __unsafe_private_named: self.__unsafe_private_named, 2798 _phantom: ::core::marker::PhantomData, 2799 } 2800 } 2801} 2802 2803impl<'a, S> ChapterViewBuilder<'a, S> 2804where 2805 S: chapter_view_state::State, 2806 S::Cid: chapter_view_state::IsUnset, 2807{ 2808 /// Set the `cid` field (required) 2809 pub fn cid( 2810 mut self, 2811 value: impl Into<jacquard_common::types::string::Cid<'a>>, 2812 ) -> ChapterViewBuilder<'a, chapter_view_state::SetCid<S>> { 2813 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 2814 ChapterViewBuilder { 2815 _phantom_state: ::core::marker::PhantomData, 2816 __unsafe_private_named: self.__unsafe_private_named, 2817 _phantom: ::core::marker::PhantomData, 2818 } 2819 } 2820} 2821 2822impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { 2823 /// Set the `entryCount` field (optional) 2824 pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self { 2825 self.__unsafe_private_named.2 = value.into(); 2826 self 2827 } 2828 /// Set the `entryCount` field to an Option value (optional) 2829 pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self { 2830 self.__unsafe_private_named.2 = value; 2831 self 2832 } 2833} 2834 2835impl<'a, S> ChapterViewBuilder<'a, S> 2836where 2837 S: chapter_view_state::State, 2838 S::IndexedAt: chapter_view_state::IsUnset, 2839{ 2840 /// Set the `indexedAt` field (required) 2841 pub fn indexed_at( 2842 mut self, 2843 value: impl Into<jacquard_common::types::string::Datetime>, 2844 ) -> ChapterViewBuilder<'a, chapter_view_state::SetIndexedAt<S>> { 2845 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 2846 ChapterViewBuilder { 2847 _phantom_state: ::core::marker::PhantomData, 2848 __unsafe_private_named: self.__unsafe_private_named, 2849 _phantom: ::core::marker::PhantomData, 2850 } 2851 } 2852} 2853 2854impl<'a, S> ChapterViewBuilder<'a, S> 2855where 2856 S: chapter_view_state::State, 2857 S::Notebook: chapter_view_state::IsUnset, 2858{ 2859 /// Set the `notebook` field (required) 2860 pub fn notebook( 2861 mut self, 2862 value: impl Into<crate::sh_weaver::notebook::NotebookView<'a>>, 2863 ) -> ChapterViewBuilder<'a, chapter_view_state::SetNotebook<S>> { 2864 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 2865 ChapterViewBuilder { 2866 _phantom_state: ::core::marker::PhantomData, 2867 __unsafe_private_named: self.__unsafe_private_named, 2868 _phantom: ::core::marker::PhantomData, 2869 } 2870 } 2871} 2872 2873impl<'a, S> ChapterViewBuilder<'a, S> 2874where 2875 S: chapter_view_state::State, 2876 S::Record: chapter_view_state::IsUnset, 2877{ 2878 /// Set the `record` field (required) 2879 pub fn record( 2880 mut self, 2881 value: impl Into<jacquard_common::types::value::Data<'a>>, 2882 ) -> ChapterViewBuilder<'a, chapter_view_state::SetRecord<S>> { 2883 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 2884 ChapterViewBuilder { 2885 _phantom_state: ::core::marker::PhantomData, 2886 __unsafe_private_named: self.__unsafe_private_named, 2887 _phantom: ::core::marker::PhantomData, 2888 } 2889 } 2890} 2891 2892impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { 2893 /// Set the `tags` field (optional) 2894 pub fn tags( 2895 mut self, 2896 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>, 2897 ) -> Self { 2898 self.__unsafe_private_named.6 = value.into(); 2899 self 2900 } 2901 /// Set the `tags` field to an Option value (optional) 2902 pub fn maybe_tags( 2903 mut self, 2904 value: Option<crate::sh_weaver::notebook::Tags<'a>>, 2905 ) -> Self { 2906 self.__unsafe_private_named.6 = value; 2907 self 2908 } 2909} 2910 2911impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { 2912 /// Set the `title` field (optional) 2913 pub fn title( 2914 mut self, 2915 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>, 2916 ) -> Self { 2917 self.__unsafe_private_named.7 = value.into(); 2918 self 2919 } 2920 /// Set the `title` field to an Option value (optional) 2921 pub fn maybe_title( 2922 mut self, 2923 value: Option<crate::sh_weaver::notebook::Title<'a>>, 2924 ) -> Self { 2925 self.__unsafe_private_named.7 = value; 2926 self 2927 } 2928} 2929 2930impl<'a, S> ChapterViewBuilder<'a, S> 2931where 2932 S: chapter_view_state::State, 2933 S::Uri: chapter_view_state::IsUnset, 2934{ 2935 /// Set the `uri` field (required) 2936 pub fn uri( 2937 mut self, 2938 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 2939 ) -> ChapterViewBuilder<'a, chapter_view_state::SetUri<S>> { 2940 self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 2941 ChapterViewBuilder { 2942 _phantom_state: ::core::marker::PhantomData, 2943 __unsafe_private_named: self.__unsafe_private_named, 2944 _phantom: ::core::marker::PhantomData, 2945 } 2946 } 2947} 2948 2949impl<'a, S> ChapterViewBuilder<'a, S> 2950where 2951 S: chapter_view_state::State, 2952 S::Record: chapter_view_state::IsSet, 2953 S::IndexedAt: chapter_view_state::IsSet, 2954 S::Authors: chapter_view_state::IsSet, 2955 S::Notebook: chapter_view_state::IsSet, 2956 S::Cid: chapter_view_state::IsSet, 2957 S::Uri: chapter_view_state::IsSet, 2958{ 2959 /// Build the final struct 2960 pub fn build(self) -> ChapterView<'a> { 2961 ChapterView { 2962 authors: self.__unsafe_private_named.0.unwrap(), 2963 cid: self.__unsafe_private_named.1.unwrap(), 2964 entry_count: self.__unsafe_private_named.2, 2965 indexed_at: self.__unsafe_private_named.3.unwrap(), 2966 notebook: self.__unsafe_private_named.4.unwrap(), 2967 record: self.__unsafe_private_named.5.unwrap(), 2968 tags: self.__unsafe_private_named.6, 2969 title: self.__unsafe_private_named.7, 2970 uri: self.__unsafe_private_named.8.unwrap(), 2971 extra_data: Default::default(), 2972 } 2973 } 2974 /// Build the final struct with custom extra_data 2975 pub fn build_with_data( 2976 self, 2977 extra_data: std::collections::BTreeMap< 2978 jacquard_common::smol_str::SmolStr, 2979 jacquard_common::types::value::Data<'a>, 2980 >, 2981 ) -> ChapterView<'a> { 2982 ChapterView { 2983 authors: self.__unsafe_private_named.0.unwrap(), 2984 cid: self.__unsafe_private_named.1.unwrap(), 2985 entry_count: self.__unsafe_private_named.2, 2986 indexed_at: self.__unsafe_private_named.3.unwrap(), 2987 notebook: self.__unsafe_private_named.4.unwrap(), 2988 record: self.__unsafe_private_named.5.unwrap(), 2989 tags: self.__unsafe_private_named.6, 2990 title: self.__unsafe_private_named.7, 2991 uri: self.__unsafe_private_named.8.unwrap(), 2992 extra_data: Some(extra_data), 2993 } 2994 } 2995} 2996 2997impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterView<'a> { 2998 fn nsid() -> &'static str { 2999 "sh.weaver.notebook.defs" 3000 } 3001 fn def_name() -> &'static str { 3002 "chapterView" 3003 } 3004 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3005 lexicon_doc_sh_weaver_notebook_defs() 3006 } 3007 fn validate( 3008 &self, 3009 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3010 Ok(()) 3011 } 3012} 3013 3014/// The format of the content. This is used to determine how to render the content. 3015#[jacquard_derive::lexicon] 3016#[derive( 3017 serde::Serialize, 3018 serde::Deserialize, 3019 Debug, 3020 Clone, 3021 PartialEq, 3022 Eq, 3023 jacquard_derive::IntoStatic, 3024 Default 3025)] 3026#[serde(rename_all = "camelCase")] 3027pub struct ContentFormat<'a> { 3028 /// The format of the content. This is used to determine how to render the content. 3029 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3030 #[serde(borrow)] 3031 pub markdown: std::option::Option<jacquard_common::CowStr<'a>>, 3032} 3033 3034impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> { 3035 fn nsid() -> &'static str { 3036 "sh.weaver.notebook.defs" 3037 } 3038 fn def_name() -> &'static str { 3039 "contentFormat" 3040 } 3041 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3042 lexicon_doc_sh_weaver_notebook_defs() 3043 } 3044 fn validate( 3045 &self, 3046 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3047 Ok(()) 3048 } 3049} 3050 3051/// Author-applied content rating. 3052#[derive(Debug, Clone, PartialEq, Eq, Hash)] 3053pub enum ContentRating<'a> { 3054 General, 3055 Teen, 3056 Mature, 3057 Explicit, 3058 Other(jacquard_common::CowStr<'a>), 3059} 3060 3061impl<'a> ContentRating<'a> { 3062 pub fn as_str(&self) -> &str { 3063 match self { 3064 Self::General => "general", 3065 Self::Teen => "teen", 3066 Self::Mature => "mature", 3067 Self::Explicit => "explicit", 3068 Self::Other(s) => s.as_ref(), 3069 } 3070 } 3071} 3072 3073impl<'a> From<&'a str> for ContentRating<'a> { 3074 fn from(s: &'a str) -> Self { 3075 match s { 3076 "general" => Self::General, 3077 "teen" => Self::Teen, 3078 "mature" => Self::Mature, 3079 "explicit" => Self::Explicit, 3080 _ => Self::Other(jacquard_common::CowStr::from(s)), 3081 } 3082 } 3083} 3084 3085impl<'a> From<String> for ContentRating<'a> { 3086 fn from(s: String) -> Self { 3087 match s.as_str() { 3088 "general" => Self::General, 3089 "teen" => Self::Teen, 3090 "mature" => Self::Mature, 3091 "explicit" => Self::Explicit, 3092 _ => Self::Other(jacquard_common::CowStr::from(s)), 3093 } 3094 } 3095} 3096 3097impl<'a> AsRef<str> for ContentRating<'a> { 3098 fn as_ref(&self) -> &str { 3099 self.as_str() 3100 } 3101} 3102 3103impl<'a> core::fmt::Display for ContentRating<'a> { 3104 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 3105 write!(f, "{}", self.as_str()) 3106 } 3107} 3108 3109impl<'a> serde::Serialize for ContentRating<'a> { 3110 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 3111 where 3112 S: serde::Serializer, 3113 { 3114 serializer.serialize_str(self.as_str()) 3115 } 3116} 3117 3118impl<'de, 'a> serde::Deserialize<'de> for ContentRating<'a> 3119where 3120 'de: 'a, 3121{ 3122 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 3123 where 3124 D: serde::Deserializer<'de>, 3125 { 3126 let s = <&'de str>::deserialize(deserializer)?; 3127 Ok(Self::from(s)) 3128 } 3129} 3130 3131impl jacquard_common::IntoStatic for ContentRating<'_> { 3132 type Output = ContentRating<'static>; 3133 fn into_static(self) -> Self::Output { 3134 match self { 3135 ContentRating::General => ContentRating::General, 3136 ContentRating::Teen => ContentRating::Teen, 3137 ContentRating::Mature => ContentRating::Mature, 3138 ContentRating::Explicit => ContentRating::Explicit, 3139 ContentRating::Other(v) => ContentRating::Other(v.into_static()), 3140 } 3141 } 3142} 3143 3144/// Author-applied content warning. 3145#[derive(Debug, Clone, PartialEq, Eq, Hash)] 3146pub enum ContentWarning<'a> { 3147 Violence, 3148 GraphicViolence, 3149 Death, 3150 MajorCharacterDeath, 3151 SexualContent, 3152 ExplicitSexualContent, 3153 Language, 3154 SubstanceUse, 3155 SelfHarm, 3156 Abuse, 3157 DisturbingImagery, 3158 Other(jacquard_common::CowStr<'a>), 3159} 3160 3161impl<'a> ContentWarning<'a> { 3162 pub fn as_str(&self) -> &str { 3163 match self { 3164 Self::Violence => "violence", 3165 Self::GraphicViolence => "graphic-violence", 3166 Self::Death => "death", 3167 Self::MajorCharacterDeath => "major-character-death", 3168 Self::SexualContent => "sexual-content", 3169 Self::ExplicitSexualContent => "explicit-sexual-content", 3170 Self::Language => "language", 3171 Self::SubstanceUse => "substance-use", 3172 Self::SelfHarm => "self-harm", 3173 Self::Abuse => "abuse", 3174 Self::DisturbingImagery => "disturbing-imagery", 3175 Self::Other(s) => s.as_ref(), 3176 } 3177 } 3178} 3179 3180impl<'a> From<&'a str> for ContentWarning<'a> { 3181 fn from(s: &'a str) -> Self { 3182 match s { 3183 "violence" => Self::Violence, 3184 "graphic-violence" => Self::GraphicViolence, 3185 "death" => Self::Death, 3186 "major-character-death" => Self::MajorCharacterDeath, 3187 "sexual-content" => Self::SexualContent, 3188 "explicit-sexual-content" => Self::ExplicitSexualContent, 3189 "language" => Self::Language, 3190 "substance-use" => Self::SubstanceUse, 3191 "self-harm" => Self::SelfHarm, 3192 "abuse" => Self::Abuse, 3193 "disturbing-imagery" => Self::DisturbingImagery, 3194 _ => Self::Other(jacquard_common::CowStr::from(s)), 3195 } 3196 } 3197} 3198 3199impl<'a> From<String> for ContentWarning<'a> { 3200 fn from(s: String) -> Self { 3201 match s.as_str() { 3202 "violence" => Self::Violence, 3203 "graphic-violence" => Self::GraphicViolence, 3204 "death" => Self::Death, 3205 "major-character-death" => Self::MajorCharacterDeath, 3206 "sexual-content" => Self::SexualContent, 3207 "explicit-sexual-content" => Self::ExplicitSexualContent, 3208 "language" => Self::Language, 3209 "substance-use" => Self::SubstanceUse, 3210 "self-harm" => Self::SelfHarm, 3211 "abuse" => Self::Abuse, 3212 "disturbing-imagery" => Self::DisturbingImagery, 3213 _ => Self::Other(jacquard_common::CowStr::from(s)), 3214 } 3215 } 3216} 3217 3218impl<'a> AsRef<str> for ContentWarning<'a> { 3219 fn as_ref(&self) -> &str { 3220 self.as_str() 3221 } 3222} 3223 3224impl<'a> core::fmt::Display for ContentWarning<'a> { 3225 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 3226 write!(f, "{}", self.as_str()) 3227 } 3228} 3229 3230impl<'a> serde::Serialize for ContentWarning<'a> { 3231 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 3232 where 3233 S: serde::Serializer, 3234 { 3235 serializer.serialize_str(self.as_str()) 3236 } 3237} 3238 3239impl<'de, 'a> serde::Deserialize<'de> for ContentWarning<'a> 3240where 3241 'de: 'a, 3242{ 3243 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 3244 where 3245 D: serde::Deserializer<'de>, 3246 { 3247 let s = <&'de str>::deserialize(deserializer)?; 3248 Ok(Self::from(s)) 3249 } 3250} 3251 3252impl jacquard_common::IntoStatic for ContentWarning<'_> { 3253 type Output = ContentWarning<'static>; 3254 fn into_static(self) -> Self::Output { 3255 match self { 3256 ContentWarning::Violence => ContentWarning::Violence, 3257 ContentWarning::GraphicViolence => ContentWarning::GraphicViolence, 3258 ContentWarning::Death => ContentWarning::Death, 3259 ContentWarning::MajorCharacterDeath => ContentWarning::MajorCharacterDeath, 3260 ContentWarning::SexualContent => ContentWarning::SexualContent, 3261 ContentWarning::ExplicitSexualContent => { 3262 ContentWarning::ExplicitSexualContent 3263 } 3264 ContentWarning::Language => ContentWarning::Language, 3265 ContentWarning::SubstanceUse => ContentWarning::SubstanceUse, 3266 ContentWarning::SelfHarm => ContentWarning::SelfHarm, 3267 ContentWarning::Abuse => ContentWarning::Abuse, 3268 ContentWarning::DisturbingImagery => ContentWarning::DisturbingImagery, 3269 ContentWarning::Other(v) => ContentWarning::Other(v.into_static()), 3270 } 3271 } 3272} 3273 3274/// Author-applied content warnings. 3275pub type ContentWarnings<'a> = Vec<crate::sh_weaver::notebook::ContentWarning<'a>>; 3276#[jacquard_derive::lexicon] 3277#[derive( 3278 serde::Serialize, 3279 serde::Deserialize, 3280 Debug, 3281 Clone, 3282 PartialEq, 3283 Eq, 3284 jacquard_derive::IntoStatic 3285)] 3286#[serde(rename_all = "camelCase")] 3287pub struct EntryView<'a> { 3288 #[serde(borrow)] 3289 pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>, 3290 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3291 pub bookmark_count: std::option::Option<i64>, 3292 #[serde(borrow)] 3293 pub cid: jacquard_common::types::string::Cid<'a>, 3294 pub indexed_at: jacquard_common::types::string::Datetime, 3295 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3296 pub like_count: std::option::Option<i64>, 3297 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3298 #[serde(borrow)] 3299 pub path: std::option::Option<crate::sh_weaver::notebook::Path<'a>>, 3300 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3301 #[serde(borrow)] 3302 pub permissions: std::option::Option< 3303 crate::sh_weaver::notebook::PermissionsState<'a>, 3304 >, 3305 #[serde(borrow)] 3306 pub record: jacquard_common::types::value::Data<'a>, 3307 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3308 #[serde(borrow)] 3309 pub rendered_view: std::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>, 3310 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3311 #[serde(borrow)] 3312 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 3313 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3314 #[serde(borrow)] 3315 pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>, 3316 #[serde(borrow)] 3317 pub uri: jacquard_common::types::string::AtUri<'a>, 3318 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3319 #[serde(borrow)] 3320 pub viewer_bookmark: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3321 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3322 #[serde(borrow)] 3323 pub viewer_like: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3324 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3325 #[serde(borrow)] 3326 pub viewer_reading_progress: std::option::Option< 3327 crate::sh_weaver::notebook::ReadingProgress<'a>, 3328 >, 3329} 3330 3331pub mod entry_view_state { 3332 3333 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 3334 #[allow(unused)] 3335 use ::core::marker::PhantomData; 3336 mod sealed { 3337 pub trait Sealed {} 3338 } 3339 /// State trait tracking which required fields have been set 3340 pub trait State: sealed::Sealed { 3341 type Authors; 3342 type Uri; 3343 type Cid; 3344 type IndexedAt; 3345 type Record; 3346 } 3347 /// Empty state - all required fields are unset 3348 pub struct Empty(()); 3349 impl sealed::Sealed for Empty {} 3350 impl State for Empty { 3351 type Authors = Unset; 3352 type Uri = Unset; 3353 type Cid = Unset; 3354 type IndexedAt = Unset; 3355 type Record = Unset; 3356 } 3357 ///State transition - sets the `authors` field to Set 3358 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 3359 impl<S: State> sealed::Sealed for SetAuthors<S> {} 3360 impl<S: State> State for SetAuthors<S> { 3361 type Authors = Set<members::authors>; 3362 type Uri = S::Uri; 3363 type Cid = S::Cid; 3364 type IndexedAt = S::IndexedAt; 3365 type Record = S::Record; 3366 } 3367 ///State transition - sets the `uri` field to Set 3368 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 3369 impl<S: State> sealed::Sealed for SetUri<S> {} 3370 impl<S: State> State for SetUri<S> { 3371 type Authors = S::Authors; 3372 type Uri = Set<members::uri>; 3373 type Cid = S::Cid; 3374 type IndexedAt = S::IndexedAt; 3375 type Record = S::Record; 3376 } 3377 ///State transition - sets the `cid` field to Set 3378 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 3379 impl<S: State> sealed::Sealed for SetCid<S> {} 3380 impl<S: State> State for SetCid<S> { 3381 type Authors = S::Authors; 3382 type Uri = S::Uri; 3383 type Cid = Set<members::cid>; 3384 type IndexedAt = S::IndexedAt; 3385 type Record = S::Record; 3386 } 3387 ///State transition - sets the `indexed_at` field to Set 3388 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 3389 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 3390 impl<S: State> State for SetIndexedAt<S> { 3391 type Authors = S::Authors; 3392 type Uri = S::Uri; 3393 type Cid = S::Cid; 3394 type IndexedAt = Set<members::indexed_at>; 3395 type Record = S::Record; 3396 } 3397 ///State transition - sets the `record` field to Set 3398 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 3399 impl<S: State> sealed::Sealed for SetRecord<S> {} 3400 impl<S: State> State for SetRecord<S> { 3401 type Authors = S::Authors; 3402 type Uri = S::Uri; 3403 type Cid = S::Cid; 3404 type IndexedAt = S::IndexedAt; 3405 type Record = Set<members::record>; 3406 } 3407 /// Marker types for field names 3408 #[allow(non_camel_case_types)] 3409 pub mod members { 3410 ///Marker type for the `authors` field 3411 pub struct authors(()); 3412 ///Marker type for the `uri` field 3413 pub struct uri(()); 3414 ///Marker type for the `cid` field 3415 pub struct cid(()); 3416 ///Marker type for the `indexed_at` field 3417 pub struct indexed_at(()); 3418 ///Marker type for the `record` field 3419 pub struct record(()); 3420 } 3421} 3422 3423/// Builder for constructing an instance of this type 3424pub struct EntryViewBuilder<'a, S: entry_view_state::State> { 3425 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 3426 __unsafe_private_named: ( 3427 ::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 3428 ::core::option::Option<i64>, 3429 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 3430 ::core::option::Option<jacquard_common::types::string::Datetime>, 3431 ::core::option::Option<i64>, 3432 ::core::option::Option<crate::sh_weaver::notebook::Path<'a>>, 3433 ::core::option::Option<crate::sh_weaver::notebook::PermissionsState<'a>>, 3434 ::core::option::Option<jacquard_common::types::value::Data<'a>>, 3435 ::core::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>, 3436 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 3437 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>, 3438 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 3439 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 3440 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 3441 ::core::option::Option<crate::sh_weaver::notebook::ReadingProgress<'a>>, 3442 ), 3443 _phantom: ::core::marker::PhantomData<&'a ()>, 3444} 3445 3446impl<'a> EntryView<'a> { 3447 /// Create a new builder for this type 3448 pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> { 3449 EntryViewBuilder::new() 3450 } 3451} 3452 3453impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> { 3454 /// Create a new builder with all fields unset 3455 pub fn new() -> Self { 3456 EntryViewBuilder { 3457 _phantom_state: ::core::marker::PhantomData, 3458 __unsafe_private_named: ( 3459 None, 3460 None, 3461 None, 3462 None, 3463 None, 3464 None, 3465 None, 3466 None, 3467 None, 3468 None, 3469 None, 3470 None, 3471 None, 3472 None, 3473 None, 3474 ), 3475 _phantom: ::core::marker::PhantomData, 3476 } 3477 } 3478} 3479 3480impl<'a, S> EntryViewBuilder<'a, S> 3481where 3482 S: entry_view_state::State, 3483 S::Authors: entry_view_state::IsUnset, 3484{ 3485 /// Set the `authors` field (required) 3486 pub fn authors( 3487 mut self, 3488 value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 3489 ) -> EntryViewBuilder<'a, entry_view_state::SetAuthors<S>> { 3490 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 3491 EntryViewBuilder { 3492 _phantom_state: ::core::marker::PhantomData, 3493 __unsafe_private_named: self.__unsafe_private_named, 3494 _phantom: ::core::marker::PhantomData, 3495 } 3496 } 3497} 3498 3499impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3500 /// Set the `bookmarkCount` field (optional) 3501 pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self { 3502 self.__unsafe_private_named.1 = value.into(); 3503 self 3504 } 3505 /// Set the `bookmarkCount` field to an Option value (optional) 3506 pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self { 3507 self.__unsafe_private_named.1 = value; 3508 self 3509 } 3510} 3511 3512impl<'a, S> EntryViewBuilder<'a, S> 3513where 3514 S: entry_view_state::State, 3515 S::Cid: entry_view_state::IsUnset, 3516{ 3517 /// Set the `cid` field (required) 3518 pub fn cid( 3519 mut self, 3520 value: impl Into<jacquard_common::types::string::Cid<'a>>, 3521 ) -> EntryViewBuilder<'a, entry_view_state::SetCid<S>> { 3522 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 3523 EntryViewBuilder { 3524 _phantom_state: ::core::marker::PhantomData, 3525 __unsafe_private_named: self.__unsafe_private_named, 3526 _phantom: ::core::marker::PhantomData, 3527 } 3528 } 3529} 3530 3531impl<'a, S> EntryViewBuilder<'a, S> 3532where 3533 S: entry_view_state::State, 3534 S::IndexedAt: entry_view_state::IsUnset, 3535{ 3536 /// Set the `indexedAt` field (required) 3537 pub fn indexed_at( 3538 mut self, 3539 value: impl Into<jacquard_common::types::string::Datetime>, 3540 ) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt<S>> { 3541 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 3542 EntryViewBuilder { 3543 _phantom_state: ::core::marker::PhantomData, 3544 __unsafe_private_named: self.__unsafe_private_named, 3545 _phantom: ::core::marker::PhantomData, 3546 } 3547 } 3548} 3549 3550impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3551 /// Set the `likeCount` field (optional) 3552 pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self { 3553 self.__unsafe_private_named.4 = value.into(); 3554 self 3555 } 3556 /// Set the `likeCount` field to an Option value (optional) 3557 pub fn maybe_like_count(mut self, value: Option<i64>) -> Self { 3558 self.__unsafe_private_named.4 = value; 3559 self 3560 } 3561} 3562 3563impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3564 /// Set the `path` field (optional) 3565 pub fn path( 3566 mut self, 3567 value: impl Into<Option<crate::sh_weaver::notebook::Path<'a>>>, 3568 ) -> Self { 3569 self.__unsafe_private_named.5 = value.into(); 3570 self 3571 } 3572 /// Set the `path` field to an Option value (optional) 3573 pub fn maybe_path( 3574 mut self, 3575 value: Option<crate::sh_weaver::notebook::Path<'a>>, 3576 ) -> Self { 3577 self.__unsafe_private_named.5 = value; 3578 self 3579 } 3580} 3581 3582impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3583 /// Set the `permissions` field (optional) 3584 pub fn permissions( 3585 mut self, 3586 value: impl Into<Option<crate::sh_weaver::notebook::PermissionsState<'a>>>, 3587 ) -> Self { 3588 self.__unsafe_private_named.6 = value.into(); 3589 self 3590 } 3591 /// Set the `permissions` field to an Option value (optional) 3592 pub fn maybe_permissions( 3593 mut self, 3594 value: Option<crate::sh_weaver::notebook::PermissionsState<'a>>, 3595 ) -> Self { 3596 self.__unsafe_private_named.6 = value; 3597 self 3598 } 3599} 3600 3601impl<'a, S> EntryViewBuilder<'a, S> 3602where 3603 S: entry_view_state::State, 3604 S::Record: entry_view_state::IsUnset, 3605{ 3606 /// Set the `record` field (required) 3607 pub fn record( 3608 mut self, 3609 value: impl Into<jacquard_common::types::value::Data<'a>>, 3610 ) -> EntryViewBuilder<'a, entry_view_state::SetRecord<S>> { 3611 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 3612 EntryViewBuilder { 3613 _phantom_state: ::core::marker::PhantomData, 3614 __unsafe_private_named: self.__unsafe_private_named, 3615 _phantom: ::core::marker::PhantomData, 3616 } 3617 } 3618} 3619 3620impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3621 /// Set the `renderedView` field (optional) 3622 pub fn rendered_view( 3623 mut self, 3624 value: impl Into<Option<crate::sh_weaver::notebook::RenderedView<'a>>>, 3625 ) -> Self { 3626 self.__unsafe_private_named.8 = value.into(); 3627 self 3628 } 3629 /// Set the `renderedView` field to an Option value (optional) 3630 pub fn maybe_rendered_view( 3631 mut self, 3632 value: Option<crate::sh_weaver::notebook::RenderedView<'a>>, 3633 ) -> Self { 3634 self.__unsafe_private_named.8 = value; 3635 self 3636 } 3637} 3638 3639impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3640 /// Set the `tags` field (optional) 3641 pub fn tags( 3642 mut self, 3643 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>, 3644 ) -> Self { 3645 self.__unsafe_private_named.9 = value.into(); 3646 self 3647 } 3648 /// Set the `tags` field to an Option value (optional) 3649 pub fn maybe_tags( 3650 mut self, 3651 value: Option<crate::sh_weaver::notebook::Tags<'a>>, 3652 ) -> Self { 3653 self.__unsafe_private_named.9 = value; 3654 self 3655 } 3656} 3657 3658impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3659 /// Set the `title` field (optional) 3660 pub fn title( 3661 mut self, 3662 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>, 3663 ) -> Self { 3664 self.__unsafe_private_named.10 = value.into(); 3665 self 3666 } 3667 /// Set the `title` field to an Option value (optional) 3668 pub fn maybe_title( 3669 mut self, 3670 value: Option<crate::sh_weaver::notebook::Title<'a>>, 3671 ) -> Self { 3672 self.__unsafe_private_named.10 = value; 3673 self 3674 } 3675} 3676 3677impl<'a, S> EntryViewBuilder<'a, S> 3678where 3679 S: entry_view_state::State, 3680 S::Uri: entry_view_state::IsUnset, 3681{ 3682 /// Set the `uri` field (required) 3683 pub fn uri( 3684 mut self, 3685 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 3686 ) -> EntryViewBuilder<'a, entry_view_state::SetUri<S>> { 3687 self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); 3688 EntryViewBuilder { 3689 _phantom_state: ::core::marker::PhantomData, 3690 __unsafe_private_named: self.__unsafe_private_named, 3691 _phantom: ::core::marker::PhantomData, 3692 } 3693 } 3694} 3695 3696impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3697 /// Set the `viewerBookmark` field (optional) 3698 pub fn viewer_bookmark( 3699 mut self, 3700 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 3701 ) -> Self { 3702 self.__unsafe_private_named.12 = value.into(); 3703 self 3704 } 3705 /// Set the `viewerBookmark` field to an Option value (optional) 3706 pub fn maybe_viewer_bookmark( 3707 mut self, 3708 value: Option<jacquard_common::types::string::AtUri<'a>>, 3709 ) -> Self { 3710 self.__unsafe_private_named.12 = value; 3711 self 3712 } 3713} 3714 3715impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3716 /// Set the `viewerLike` field (optional) 3717 pub fn viewer_like( 3718 mut self, 3719 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 3720 ) -> Self { 3721 self.__unsafe_private_named.13 = value.into(); 3722 self 3723 } 3724 /// Set the `viewerLike` field to an Option value (optional) 3725 pub fn maybe_viewer_like( 3726 mut self, 3727 value: Option<jacquard_common::types::string::AtUri<'a>>, 3728 ) -> Self { 3729 self.__unsafe_private_named.13 = value; 3730 self 3731 } 3732} 3733 3734impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { 3735 /// Set the `viewerReadingProgress` field (optional) 3736 pub fn viewer_reading_progress( 3737 mut self, 3738 value: impl Into<Option<crate::sh_weaver::notebook::ReadingProgress<'a>>>, 3739 ) -> Self { 3740 self.__unsafe_private_named.14 = value.into(); 3741 self 3742 } 3743 /// Set the `viewerReadingProgress` field to an Option value (optional) 3744 pub fn maybe_viewer_reading_progress( 3745 mut self, 3746 value: Option<crate::sh_weaver::notebook::ReadingProgress<'a>>, 3747 ) -> Self { 3748 self.__unsafe_private_named.14 = value; 3749 self 3750 } 3751} 3752 3753impl<'a, S> EntryViewBuilder<'a, S> 3754where 3755 S: entry_view_state::State, 3756 S::Authors: entry_view_state::IsSet, 3757 S::Uri: entry_view_state::IsSet, 3758 S::Cid: entry_view_state::IsSet, 3759 S::IndexedAt: entry_view_state::IsSet, 3760 S::Record: entry_view_state::IsSet, 3761{ 3762 /// Build the final struct 3763 pub fn build(self) -> EntryView<'a> { 3764 EntryView { 3765 authors: self.__unsafe_private_named.0.unwrap(), 3766 bookmark_count: self.__unsafe_private_named.1, 3767 cid: self.__unsafe_private_named.2.unwrap(), 3768 indexed_at: self.__unsafe_private_named.3.unwrap(), 3769 like_count: self.__unsafe_private_named.4, 3770 path: self.__unsafe_private_named.5, 3771 permissions: self.__unsafe_private_named.6, 3772 record: self.__unsafe_private_named.7.unwrap(), 3773 rendered_view: self.__unsafe_private_named.8, 3774 tags: self.__unsafe_private_named.9, 3775 title: self.__unsafe_private_named.10, 3776 uri: self.__unsafe_private_named.11.unwrap(), 3777 viewer_bookmark: self.__unsafe_private_named.12, 3778 viewer_like: self.__unsafe_private_named.13, 3779 viewer_reading_progress: self.__unsafe_private_named.14, 3780 extra_data: Default::default(), 3781 } 3782 } 3783 /// Build the final struct with custom extra_data 3784 pub fn build_with_data( 3785 self, 3786 extra_data: std::collections::BTreeMap< 3787 jacquard_common::smol_str::SmolStr, 3788 jacquard_common::types::value::Data<'a>, 3789 >, 3790 ) -> EntryView<'a> { 3791 EntryView { 3792 authors: self.__unsafe_private_named.0.unwrap(), 3793 bookmark_count: self.__unsafe_private_named.1, 3794 cid: self.__unsafe_private_named.2.unwrap(), 3795 indexed_at: self.__unsafe_private_named.3.unwrap(), 3796 like_count: self.__unsafe_private_named.4, 3797 path: self.__unsafe_private_named.5, 3798 permissions: self.__unsafe_private_named.6, 3799 record: self.__unsafe_private_named.7.unwrap(), 3800 rendered_view: self.__unsafe_private_named.8, 3801 tags: self.__unsafe_private_named.9, 3802 title: self.__unsafe_private_named.10, 3803 uri: self.__unsafe_private_named.11.unwrap(), 3804 viewer_bookmark: self.__unsafe_private_named.12, 3805 viewer_like: self.__unsafe_private_named.13, 3806 viewer_reading_progress: self.__unsafe_private_named.14, 3807 extra_data: Some(extra_data), 3808 } 3809 } 3810} 3811 3812impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> { 3813 fn nsid() -> &'static str { 3814 "sh.weaver.notebook.defs" 3815 } 3816 fn def_name() -> &'static str { 3817 "entryView" 3818 } 3819 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3820 lexicon_doc_sh_weaver_notebook_defs() 3821 } 3822 fn validate( 3823 &self, 3824 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3825 Ok(()) 3826 } 3827} 3828 3829/// Entry with feed-specific context (discovery reason, notebook context). 3830#[jacquard_derive::lexicon] 3831#[derive( 3832 serde::Serialize, 3833 serde::Deserialize, 3834 Debug, 3835 Clone, 3836 PartialEq, 3837 Eq, 3838 jacquard_derive::IntoStatic 3839)] 3840#[serde(rename_all = "camelCase")] 3841pub struct FeedEntryView<'a> { 3842 #[serde(borrow)] 3843 pub entry: crate::sh_weaver::notebook::EntryView<'a>, 3844 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3845 #[serde(borrow)] 3846 pub notebook_context: std::option::Option< 3847 crate::sh_weaver::notebook::FeedNotebookContext<'a>, 3848 >, 3849 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3850 #[serde(borrow)] 3851 pub reason: std::option::Option<crate::sh_weaver::notebook::FeedReason<'a>>, 3852} 3853 3854pub mod feed_entry_view_state { 3855 3856 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 3857 #[allow(unused)] 3858 use ::core::marker::PhantomData; 3859 mod sealed { 3860 pub trait Sealed {} 3861 } 3862 /// State trait tracking which required fields have been set 3863 pub trait State: sealed::Sealed { 3864 type Entry; 3865 } 3866 /// Empty state - all required fields are unset 3867 pub struct Empty(()); 3868 impl sealed::Sealed for Empty {} 3869 impl State for Empty { 3870 type Entry = Unset; 3871 } 3872 ///State transition - sets the `entry` field to Set 3873 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>); 3874 impl<S: State> sealed::Sealed for SetEntry<S> {} 3875 impl<S: State> State for SetEntry<S> { 3876 type Entry = Set<members::entry>; 3877 } 3878 /// Marker types for field names 3879 #[allow(non_camel_case_types)] 3880 pub mod members { 3881 ///Marker type for the `entry` field 3882 pub struct entry(()); 3883 } 3884} 3885 3886/// Builder for constructing an instance of this type 3887pub struct FeedEntryViewBuilder<'a, S: feed_entry_view_state::State> { 3888 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 3889 __unsafe_private_named: ( 3890 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>, 3891 ::core::option::Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>, 3892 ::core::option::Option<crate::sh_weaver::notebook::FeedReason<'a>>, 3893 ), 3894 _phantom: ::core::marker::PhantomData<&'a ()>, 3895} 3896 3897impl<'a> FeedEntryView<'a> { 3898 /// Create a new builder for this type 3899 pub fn new() -> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { 3900 FeedEntryViewBuilder::new() 3901 } 3902} 3903 3904impl<'a> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { 3905 /// Create a new builder with all fields unset 3906 pub fn new() -> Self { 3907 FeedEntryViewBuilder { 3908 _phantom_state: ::core::marker::PhantomData, 3909 __unsafe_private_named: (None, None, None), 3910 _phantom: ::core::marker::PhantomData, 3911 } 3912 } 3913} 3914 3915impl<'a, S> FeedEntryViewBuilder<'a, S> 3916where 3917 S: feed_entry_view_state::State, 3918 S::Entry: feed_entry_view_state::IsUnset, 3919{ 3920 /// Set the `entry` field (required) 3921 pub fn entry( 3922 mut self, 3923 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>, 3924 ) -> FeedEntryViewBuilder<'a, feed_entry_view_state::SetEntry<S>> { 3925 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 3926 FeedEntryViewBuilder { 3927 _phantom_state: ::core::marker::PhantomData, 3928 __unsafe_private_named: self.__unsafe_private_named, 3929 _phantom: ::core::marker::PhantomData, 3930 } 3931 } 3932} 3933 3934impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { 3935 /// Set the `notebookContext` field (optional) 3936 pub fn notebook_context( 3937 mut self, 3938 value: impl Into<Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>>, 3939 ) -> Self { 3940 self.__unsafe_private_named.1 = value.into(); 3941 self 3942 } 3943 /// Set the `notebookContext` field to an Option value (optional) 3944 pub fn maybe_notebook_context( 3945 mut self, 3946 value: Option<crate::sh_weaver::notebook::FeedNotebookContext<'a>>, 3947 ) -> Self { 3948 self.__unsafe_private_named.1 = value; 3949 self 3950 } 3951} 3952 3953impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { 3954 /// Set the `reason` field (optional) 3955 pub fn reason( 3956 mut self, 3957 value: impl Into<Option<crate::sh_weaver::notebook::FeedReason<'a>>>, 3958 ) -> Self { 3959 self.__unsafe_private_named.2 = value.into(); 3960 self 3961 } 3962 /// Set the `reason` field to an Option value (optional) 3963 pub fn maybe_reason( 3964 mut self, 3965 value: Option<crate::sh_weaver::notebook::FeedReason<'a>>, 3966 ) -> Self { 3967 self.__unsafe_private_named.2 = value; 3968 self 3969 } 3970} 3971 3972impl<'a, S> FeedEntryViewBuilder<'a, S> 3973where 3974 S: feed_entry_view_state::State, 3975 S::Entry: feed_entry_view_state::IsSet, 3976{ 3977 /// Build the final struct 3978 pub fn build(self) -> FeedEntryView<'a> { 3979 FeedEntryView { 3980 entry: self.__unsafe_private_named.0.unwrap(), 3981 notebook_context: self.__unsafe_private_named.1, 3982 reason: self.__unsafe_private_named.2, 3983 extra_data: Default::default(), 3984 } 3985 } 3986 /// Build the final struct with custom extra_data 3987 pub fn build_with_data( 3988 self, 3989 extra_data: std::collections::BTreeMap< 3990 jacquard_common::smol_str::SmolStr, 3991 jacquard_common::types::value::Data<'a>, 3992 >, 3993 ) -> FeedEntryView<'a> { 3994 FeedEntryView { 3995 entry: self.__unsafe_private_named.0.unwrap(), 3996 notebook_context: self.__unsafe_private_named.1, 3997 reason: self.__unsafe_private_named.2, 3998 extra_data: Some(extra_data), 3999 } 4000 } 4001} 4002 4003impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedEntryView<'a> { 4004 fn nsid() -> &'static str { 4005 "sh.weaver.notebook.defs" 4006 } 4007 fn def_name() -> &'static str { 4008 "feedEntryView" 4009 } 4010 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 4011 lexicon_doc_sh_weaver_notebook_defs() 4012 } 4013 fn validate( 4014 &self, 4015 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 4016 Ok(()) 4017 } 4018} 4019 4020/// Minimal notebook context for feed display. 4021#[jacquard_derive::lexicon] 4022#[derive( 4023 serde::Serialize, 4024 serde::Deserialize, 4025 Debug, 4026 Clone, 4027 PartialEq, 4028 Eq, 4029 jacquard_derive::IntoStatic 4030)] 4031#[serde(rename_all = "camelCase")] 4032pub struct FeedNotebookContext<'a> { 4033 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4034 #[serde(borrow)] 4035 pub path: std::option::Option<jacquard_common::CowStr<'a>>, 4036 #[serde(borrow)] 4037 pub title: jacquard_common::CowStr<'a>, 4038 #[serde(borrow)] 4039 pub uri: jacquard_common::types::string::AtUri<'a>, 4040} 4041 4042pub mod feed_notebook_context_state { 4043 4044 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 4045 #[allow(unused)] 4046 use ::core::marker::PhantomData; 4047 mod sealed { 4048 pub trait Sealed {} 4049 } 4050 /// State trait tracking which required fields have been set 4051 pub trait State: sealed::Sealed { 4052 type Title; 4053 type Uri; 4054 } 4055 /// Empty state - all required fields are unset 4056 pub struct Empty(()); 4057 impl sealed::Sealed for Empty {} 4058 impl State for Empty { 4059 type Title = Unset; 4060 type Uri = Unset; 4061 } 4062 ///State transition - sets the `title` field to Set 4063 pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 4064 impl<S: State> sealed::Sealed for SetTitle<S> {} 4065 impl<S: State> State for SetTitle<S> { 4066 type Title = Set<members::title>; 4067 type Uri = S::Uri; 4068 } 4069 ///State transition - sets the `uri` field to Set 4070 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4071 impl<S: State> sealed::Sealed for SetUri<S> {} 4072 impl<S: State> State for SetUri<S> { 4073 type Title = S::Title; 4074 type Uri = Set<members::uri>; 4075 } 4076 /// Marker types for field names 4077 #[allow(non_camel_case_types)] 4078 pub mod members { 4079 ///Marker type for the `title` field 4080 pub struct title(()); 4081 ///Marker type for the `uri` field 4082 pub struct uri(()); 4083 } 4084} 4085 4086/// Builder for constructing an instance of this type 4087pub struct FeedNotebookContextBuilder<'a, S: feed_notebook_context_state::State> { 4088 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 4089 __unsafe_private_named: ( 4090 ::core::option::Option<jacquard_common::CowStr<'a>>, 4091 ::core::option::Option<jacquard_common::CowStr<'a>>, 4092 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4093 ), 4094 _phantom: ::core::marker::PhantomData<&'a ()>, 4095} 4096 4097impl<'a> FeedNotebookContext<'a> { 4098 /// Create a new builder for this type 4099 pub fn new() -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { 4100 FeedNotebookContextBuilder::new() 4101 } 4102} 4103 4104impl<'a> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { 4105 /// Create a new builder with all fields unset 4106 pub fn new() -> Self { 4107 FeedNotebookContextBuilder { 4108 _phantom_state: ::core::marker::PhantomData, 4109 __unsafe_private_named: (None, None, None), 4110 _phantom: ::core::marker::PhantomData, 4111 } 4112 } 4113} 4114 4115impl<'a, S: feed_notebook_context_state::State> FeedNotebookContextBuilder<'a, S> { 4116 /// Set the `path` field (optional) 4117 pub fn path( 4118 mut self, 4119 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 4120 ) -> Self { 4121 self.__unsafe_private_named.0 = value.into(); 4122 self 4123 } 4124 /// Set the `path` field to an Option value (optional) 4125 pub fn maybe_path(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 4126 self.__unsafe_private_named.0 = value; 4127 self 4128 } 4129} 4130 4131impl<'a, S> FeedNotebookContextBuilder<'a, S> 4132where 4133 S: feed_notebook_context_state::State, 4134 S::Title: feed_notebook_context_state::IsUnset, 4135{ 4136 /// Set the `title` field (required) 4137 pub fn title( 4138 mut self, 4139 value: impl Into<jacquard_common::CowStr<'a>>, 4140 ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetTitle<S>> { 4141 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 4142 FeedNotebookContextBuilder { 4143 _phantom_state: ::core::marker::PhantomData, 4144 __unsafe_private_named: self.__unsafe_private_named, 4145 _phantom: ::core::marker::PhantomData, 4146 } 4147 } 4148} 4149 4150impl<'a, S> FeedNotebookContextBuilder<'a, S> 4151where 4152 S: feed_notebook_context_state::State, 4153 S::Uri: feed_notebook_context_state::IsUnset, 4154{ 4155 /// Set the `uri` field (required) 4156 pub fn uri( 4157 mut self, 4158 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 4159 ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetUri<S>> { 4160 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 4161 FeedNotebookContextBuilder { 4162 _phantom_state: ::core::marker::PhantomData, 4163 __unsafe_private_named: self.__unsafe_private_named, 4164 _phantom: ::core::marker::PhantomData, 4165 } 4166 } 4167} 4168 4169impl<'a, S> FeedNotebookContextBuilder<'a, S> 4170where 4171 S: feed_notebook_context_state::State, 4172 S::Title: feed_notebook_context_state::IsSet, 4173 S::Uri: feed_notebook_context_state::IsSet, 4174{ 4175 /// Build the final struct 4176 pub fn build(self) -> FeedNotebookContext<'a> { 4177 FeedNotebookContext { 4178 path: self.__unsafe_private_named.0, 4179 title: self.__unsafe_private_named.1.unwrap(), 4180 uri: self.__unsafe_private_named.2.unwrap(), 4181 extra_data: Default::default(), 4182 } 4183 } 4184 /// Build the final struct with custom extra_data 4185 pub fn build_with_data( 4186 self, 4187 extra_data: std::collections::BTreeMap< 4188 jacquard_common::smol_str::SmolStr, 4189 jacquard_common::types::value::Data<'a>, 4190 >, 4191 ) -> FeedNotebookContext<'a> { 4192 FeedNotebookContext { 4193 path: self.__unsafe_private_named.0, 4194 title: self.__unsafe_private_named.1.unwrap(), 4195 uri: self.__unsafe_private_named.2.unwrap(), 4196 extra_data: Some(extra_data), 4197 } 4198 } 4199} 4200 4201impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedNotebookContext<'a> { 4202 fn nsid() -> &'static str { 4203 "sh.weaver.notebook.defs" 4204 } 4205 fn def_name() -> &'static str { 4206 "feedNotebookContext" 4207 } 4208 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 4209 lexicon_doc_sh_weaver_notebook_defs() 4210 } 4211 fn validate( 4212 &self, 4213 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 4214 Ok(()) 4215 } 4216} 4217 4218///Why this entry appeared in the feed. 4219#[jacquard_derive::open_union] 4220#[derive( 4221 serde::Serialize, 4222 serde::Deserialize, 4223 Debug, 4224 Clone, 4225 PartialEq, 4226 Eq, 4227 jacquard_derive::IntoStatic 4228)] 4229#[serde(tag = "$type")] 4230#[serde(bound(deserialize = "'de: 'a"))] 4231pub enum FeedReason<'a> { 4232 #[serde(rename = "sh.weaver.notebook.defs#reasonLike")] 4233 ReasonLike(Box<crate::sh_weaver::notebook::ReasonLike<'a>>), 4234 #[serde(rename = "sh.weaver.notebook.defs#reasonBookmark")] 4235 ReasonBookmark(Box<crate::sh_weaver::notebook::ReasonBookmark<'a>>), 4236 #[serde(rename = "sh.weaver.notebook.defs#reasonSubscription")] 4237 ReasonSubscription(Box<crate::sh_weaver::notebook::ReasonSubscription<'a>>), 4238} 4239 4240#[jacquard_derive::lexicon] 4241#[derive( 4242 serde::Serialize, 4243 serde::Deserialize, 4244 Debug, 4245 Clone, 4246 PartialEq, 4247 Eq, 4248 jacquard_derive::IntoStatic 4249)] 4250#[serde(rename_all = "camelCase")] 4251pub struct NotebookView<'a> { 4252 #[serde(borrow)] 4253 pub authors: Vec<crate::sh_weaver::notebook::AuthorListView<'a>>, 4254 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4255 pub bookmark_count: std::option::Option<i64>, 4256 #[serde(borrow)] 4257 pub cid: jacquard_common::types::string::Cid<'a>, 4258 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4259 pub entry_count: std::option::Option<i64>, 4260 pub indexed_at: jacquard_common::types::string::Datetime, 4261 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4262 pub like_count: std::option::Option<i64>, 4263 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4264 #[serde(borrow)] 4265 pub path: std::option::Option<crate::sh_weaver::notebook::Path<'a>>, 4266 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4267 #[serde(borrow)] 4268 pub permissions: std::option::Option< 4269 crate::sh_weaver::notebook::PermissionsState<'a>, 4270 >, 4271 #[serde(borrow)] 4272 pub record: jacquard_common::types::value::Data<'a>, 4273 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4274 pub subscriber_count: std::option::Option<i64>, 4275 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4276 #[serde(borrow)] 4277 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 4278 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4279 #[serde(borrow)] 4280 pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>, 4281 #[serde(borrow)] 4282 pub uri: jacquard_common::types::string::AtUri<'a>, 4283 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4284 #[serde(borrow)] 4285 pub viewer_bookmark: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 4286 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4287 #[serde(borrow)] 4288 pub viewer_like: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 4289 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4290 #[serde(borrow)] 4291 pub viewer_reading_progress: std::option::Option< 4292 crate::sh_weaver::notebook::ReadingProgress<'a>, 4293 >, 4294 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4295 #[serde(borrow)] 4296 pub viewer_subscription: std::option::Option< 4297 jacquard_common::types::string::AtUri<'a>, 4298 >, 4299} 4300 4301pub mod notebook_view_state { 4302 4303 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 4304 #[allow(unused)] 4305 use ::core::marker::PhantomData; 4306 mod sealed { 4307 pub trait Sealed {} 4308 } 4309 /// State trait tracking which required fields have been set 4310 pub trait State: sealed::Sealed { 4311 type Record; 4312 type Authors; 4313 type Cid; 4314 type Uri; 4315 type IndexedAt; 4316 } 4317 /// Empty state - all required fields are unset 4318 pub struct Empty(()); 4319 impl sealed::Sealed for Empty {} 4320 impl State for Empty { 4321 type Record = Unset; 4322 type Authors = Unset; 4323 type Cid = Unset; 4324 type Uri = Unset; 4325 type IndexedAt = Unset; 4326 } 4327 ///State transition - sets the `record` field to Set 4328 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4329 impl<S: State> sealed::Sealed for SetRecord<S> {} 4330 impl<S: State> State for SetRecord<S> { 4331 type Record = Set<members::record>; 4332 type Authors = S::Authors; 4333 type Cid = S::Cid; 4334 type Uri = S::Uri; 4335 type IndexedAt = S::IndexedAt; 4336 } 4337 ///State transition - sets the `authors` field to Set 4338 pub struct SetAuthors<S: State = Empty>(PhantomData<fn() -> S>); 4339 impl<S: State> sealed::Sealed for SetAuthors<S> {} 4340 impl<S: State> State for SetAuthors<S> { 4341 type Record = S::Record; 4342 type Authors = Set<members::authors>; 4343 type Cid = S::Cid; 4344 type Uri = S::Uri; 4345 type IndexedAt = S::IndexedAt; 4346 } 4347 ///State transition - sets the `cid` field to Set 4348 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4349 impl<S: State> sealed::Sealed for SetCid<S> {} 4350 impl<S: State> State for SetCid<S> { 4351 type Record = S::Record; 4352 type Authors = S::Authors; 4353 type Cid = Set<members::cid>; 4354 type Uri = S::Uri; 4355 type IndexedAt = S::IndexedAt; 4356 } 4357 ///State transition - sets the `uri` field to Set 4358 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4359 impl<S: State> sealed::Sealed for SetUri<S> {} 4360 impl<S: State> State for SetUri<S> { 4361 type Record = S::Record; 4362 type Authors = S::Authors; 4363 type Cid = S::Cid; 4364 type Uri = Set<members::uri>; 4365 type IndexedAt = S::IndexedAt; 4366 } 4367 ///State transition - sets the `indexed_at` field to Set 4368 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4369 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4370 impl<S: State> State for SetIndexedAt<S> { 4371 type Record = S::Record; 4372 type Authors = S::Authors; 4373 type Cid = S::Cid; 4374 type Uri = S::Uri; 4375 type IndexedAt = Set<members::indexed_at>; 4376 } 4377 /// Marker types for field names 4378 #[allow(non_camel_case_types)] 4379 pub mod members { 4380 ///Marker type for the `record` field 4381 pub struct record(()); 4382 ///Marker type for the `authors` field 4383 pub struct authors(()); 4384 ///Marker type for the `cid` field 4385 pub struct cid(()); 4386 ///Marker type for the `uri` field 4387 pub struct uri(()); 4388 ///Marker type for the `indexed_at` field 4389 pub struct indexed_at(()); 4390 } 4391} 4392 4393/// Builder for constructing an instance of this type 4394pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> { 4395 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 4396 __unsafe_private_named: ( 4397 ::core::option::Option<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 4398 ::core::option::Option<i64>, 4399 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 4400 ::core::option::Option<i64>, 4401 ::core::option::Option<jacquard_common::types::string::Datetime>, 4402 ::core::option::Option<i64>, 4403 ::core::option::Option<crate::sh_weaver::notebook::Path<'a>>, 4404 ::core::option::Option<crate::sh_weaver::notebook::PermissionsState<'a>>, 4405 ::core::option::Option<jacquard_common::types::value::Data<'a>>, 4406 ::core::option::Option<i64>, 4407 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 4408 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>, 4409 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4410 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4411 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4412 ::core::option::Option<crate::sh_weaver::notebook::ReadingProgress<'a>>, 4413 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4414 ), 4415 _phantom: ::core::marker::PhantomData<&'a ()>, 4416} 4417 4418impl<'a> NotebookView<'a> { 4419 /// Create a new builder for this type 4420 pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> { 4421 NotebookViewBuilder::new() 4422 } 4423} 4424 4425impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> { 4426 /// Create a new builder with all fields unset 4427 pub fn new() -> Self { 4428 NotebookViewBuilder { 4429 _phantom_state: ::core::marker::PhantomData, 4430 __unsafe_private_named: ( 4431 None, 4432 None, 4433 None, 4434 None, 4435 None, 4436 None, 4437 None, 4438 None, 4439 None, 4440 None, 4441 None, 4442 None, 4443 None, 4444 None, 4445 None, 4446 None, 4447 None, 4448 ), 4449 _phantom: ::core::marker::PhantomData, 4450 } 4451 } 4452} 4453 4454impl<'a, S> NotebookViewBuilder<'a, S> 4455where 4456 S: notebook_view_state::State, 4457 S::Authors: notebook_view_state::IsUnset, 4458{ 4459 /// Set the `authors` field (required) 4460 pub fn authors( 4461 mut self, 4462 value: impl Into<Vec<crate::sh_weaver::notebook::AuthorListView<'a>>>, 4463 ) -> NotebookViewBuilder<'a, notebook_view_state::SetAuthors<S>> { 4464 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 4465 NotebookViewBuilder { 4466 _phantom_state: ::core::marker::PhantomData, 4467 __unsafe_private_named: self.__unsafe_private_named, 4468 _phantom: ::core::marker::PhantomData, 4469 } 4470 } 4471} 4472 4473impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4474 /// Set the `bookmarkCount` field (optional) 4475 pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self { 4476 self.__unsafe_private_named.1 = value.into(); 4477 self 4478 } 4479 /// Set the `bookmarkCount` field to an Option value (optional) 4480 pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self { 4481 self.__unsafe_private_named.1 = value; 4482 self 4483 } 4484} 4485 4486impl<'a, S> NotebookViewBuilder<'a, S> 4487where 4488 S: notebook_view_state::State, 4489 S::Cid: notebook_view_state::IsUnset, 4490{ 4491 /// Set the `cid` field (required) 4492 pub fn cid( 4493 mut self, 4494 value: impl Into<jacquard_common::types::string::Cid<'a>>, 4495 ) -> NotebookViewBuilder<'a, notebook_view_state::SetCid<S>> { 4496 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 4497 NotebookViewBuilder { 4498 _phantom_state: ::core::marker::PhantomData, 4499 __unsafe_private_named: self.__unsafe_private_named, 4500 _phantom: ::core::marker::PhantomData, 4501 } 4502 } 4503} 4504 4505impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4506 /// Set the `entryCount` field (optional) 4507 pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self { 4508 self.__unsafe_private_named.3 = value.into(); 4509 self 4510 } 4511 /// Set the `entryCount` field to an Option value (optional) 4512 pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self { 4513 self.__unsafe_private_named.3 = value; 4514 self 4515 } 4516} 4517 4518impl<'a, S> NotebookViewBuilder<'a, S> 4519where 4520 S: notebook_view_state::State, 4521 S::IndexedAt: notebook_view_state::IsUnset, 4522{ 4523 /// Set the `indexedAt` field (required) 4524 pub fn indexed_at( 4525 mut self, 4526 value: impl Into<jacquard_common::types::string::Datetime>, 4527 ) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt<S>> { 4528 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 4529 NotebookViewBuilder { 4530 _phantom_state: ::core::marker::PhantomData, 4531 __unsafe_private_named: self.__unsafe_private_named, 4532 _phantom: ::core::marker::PhantomData, 4533 } 4534 } 4535} 4536 4537impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4538 /// Set the `likeCount` field (optional) 4539 pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self { 4540 self.__unsafe_private_named.5 = value.into(); 4541 self 4542 } 4543 /// Set the `likeCount` field to an Option value (optional) 4544 pub fn maybe_like_count(mut self, value: Option<i64>) -> Self { 4545 self.__unsafe_private_named.5 = value; 4546 self 4547 } 4548} 4549 4550impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4551 /// Set the `path` field (optional) 4552 pub fn path( 4553 mut self, 4554 value: impl Into<Option<crate::sh_weaver::notebook::Path<'a>>>, 4555 ) -> Self { 4556 self.__unsafe_private_named.6 = value.into(); 4557 self 4558 } 4559 /// Set the `path` field to an Option value (optional) 4560 pub fn maybe_path( 4561 mut self, 4562 value: Option<crate::sh_weaver::notebook::Path<'a>>, 4563 ) -> Self { 4564 self.__unsafe_private_named.6 = value; 4565 self 4566 } 4567} 4568 4569impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4570 /// Set the `permissions` field (optional) 4571 pub fn permissions( 4572 mut self, 4573 value: impl Into<Option<crate::sh_weaver::notebook::PermissionsState<'a>>>, 4574 ) -> Self { 4575 self.__unsafe_private_named.7 = value.into(); 4576 self 4577 } 4578 /// Set the `permissions` field to an Option value (optional) 4579 pub fn maybe_permissions( 4580 mut self, 4581 value: Option<crate::sh_weaver::notebook::PermissionsState<'a>>, 4582 ) -> Self { 4583 self.__unsafe_private_named.7 = value; 4584 self 4585 } 4586} 4587 4588impl<'a, S> NotebookViewBuilder<'a, S> 4589where 4590 S: notebook_view_state::State, 4591 S::Record: notebook_view_state::IsUnset, 4592{ 4593 /// Set the `record` field (required) 4594 pub fn record( 4595 mut self, 4596 value: impl Into<jacquard_common::types::value::Data<'a>>, 4597 ) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord<S>> { 4598 self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 4599 NotebookViewBuilder { 4600 _phantom_state: ::core::marker::PhantomData, 4601 __unsafe_private_named: self.__unsafe_private_named, 4602 _phantom: ::core::marker::PhantomData, 4603 } 4604 } 4605} 4606 4607impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4608 /// Set the `subscriberCount` field (optional) 4609 pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self { 4610 self.__unsafe_private_named.9 = value.into(); 4611 self 4612 } 4613 /// Set the `subscriberCount` field to an Option value (optional) 4614 pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self { 4615 self.__unsafe_private_named.9 = value; 4616 self 4617 } 4618} 4619 4620impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4621 /// Set the `tags` field (optional) 4622 pub fn tags( 4623 mut self, 4624 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>, 4625 ) -> Self { 4626 self.__unsafe_private_named.10 = value.into(); 4627 self 4628 } 4629 /// Set the `tags` field to an Option value (optional) 4630 pub fn maybe_tags( 4631 mut self, 4632 value: Option<crate::sh_weaver::notebook::Tags<'a>>, 4633 ) -> Self { 4634 self.__unsafe_private_named.10 = value; 4635 self 4636 } 4637} 4638 4639impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4640 /// Set the `title` field (optional) 4641 pub fn title( 4642 mut self, 4643 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>, 4644 ) -> Self { 4645 self.__unsafe_private_named.11 = value.into(); 4646 self 4647 } 4648 /// Set the `title` field to an Option value (optional) 4649 pub fn maybe_title( 4650 mut self, 4651 value: Option<crate::sh_weaver::notebook::Title<'a>>, 4652 ) -> Self { 4653 self.__unsafe_private_named.11 = value; 4654 self 4655 } 4656} 4657 4658impl<'a, S> NotebookViewBuilder<'a, S> 4659where 4660 S: notebook_view_state::State, 4661 S::Uri: notebook_view_state::IsUnset, 4662{ 4663 /// Set the `uri` field (required) 4664 pub fn uri( 4665 mut self, 4666 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 4667 ) -> NotebookViewBuilder<'a, notebook_view_state::SetUri<S>> { 4668 self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); 4669 NotebookViewBuilder { 4670 _phantom_state: ::core::marker::PhantomData, 4671 __unsafe_private_named: self.__unsafe_private_named, 4672 _phantom: ::core::marker::PhantomData, 4673 } 4674 } 4675} 4676 4677impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4678 /// Set the `viewerBookmark` field (optional) 4679 pub fn viewer_bookmark( 4680 mut self, 4681 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 4682 ) -> Self { 4683 self.__unsafe_private_named.13 = value.into(); 4684 self 4685 } 4686 /// Set the `viewerBookmark` field to an Option value (optional) 4687 pub fn maybe_viewer_bookmark( 4688 mut self, 4689 value: Option<jacquard_common::types::string::AtUri<'a>>, 4690 ) -> Self { 4691 self.__unsafe_private_named.13 = value; 4692 self 4693 } 4694} 4695 4696impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4697 /// Set the `viewerLike` field (optional) 4698 pub fn viewer_like( 4699 mut self, 4700 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 4701 ) -> Self { 4702 self.__unsafe_private_named.14 = value.into(); 4703 self 4704 } 4705 /// Set the `viewerLike` field to an Option value (optional) 4706 pub fn maybe_viewer_like( 4707 mut self, 4708 value: Option<jacquard_common::types::string::AtUri<'a>>, 4709 ) -> Self { 4710 self.__unsafe_private_named.14 = value; 4711 self 4712 } 4713} 4714 4715impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4716 /// Set the `viewerReadingProgress` field (optional) 4717 pub fn viewer_reading_progress( 4718 mut self, 4719 value: impl Into<Option<crate::sh_weaver::notebook::ReadingProgress<'a>>>, 4720 ) -> Self { 4721 self.__unsafe_private_named.15 = value.into(); 4722 self 4723 } 4724 /// Set the `viewerReadingProgress` field to an Option value (optional) 4725 pub fn maybe_viewer_reading_progress( 4726 mut self, 4727 value: Option<crate::sh_weaver::notebook::ReadingProgress<'a>>, 4728 ) -> Self { 4729 self.__unsafe_private_named.15 = value; 4730 self 4731 } 4732} 4733 4734impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { 4735 /// Set the `viewerSubscription` field (optional) 4736 pub fn viewer_subscription( 4737 mut self, 4738 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 4739 ) -> Self { 4740 self.__unsafe_private_named.16 = value.into(); 4741 self 4742 } 4743 /// Set the `viewerSubscription` field to an Option value (optional) 4744 pub fn maybe_viewer_subscription( 4745 mut self, 4746 value: Option<jacquard_common::types::string::AtUri<'a>>, 4747 ) -> Self { 4748 self.__unsafe_private_named.16 = value; 4749 self 4750 } 4751} 4752 4753impl<'a, S> NotebookViewBuilder<'a, S> 4754where 4755 S: notebook_view_state::State, 4756 S::Record: notebook_view_state::IsSet, 4757 S::Authors: notebook_view_state::IsSet, 4758 S::Cid: notebook_view_state::IsSet, 4759 S::Uri: notebook_view_state::IsSet, 4760 S::IndexedAt: notebook_view_state::IsSet, 4761{ 4762 /// Build the final struct 4763 pub fn build(self) -> NotebookView<'a> { 4764 NotebookView { 4765 authors: self.__unsafe_private_named.0.unwrap(), 4766 bookmark_count: self.__unsafe_private_named.1, 4767 cid: self.__unsafe_private_named.2.unwrap(), 4768 entry_count: self.__unsafe_private_named.3, 4769 indexed_at: self.__unsafe_private_named.4.unwrap(), 4770 like_count: self.__unsafe_private_named.5, 4771 path: self.__unsafe_private_named.6, 4772 permissions: self.__unsafe_private_named.7, 4773 record: self.__unsafe_private_named.8.unwrap(), 4774 subscriber_count: self.__unsafe_private_named.9, 4775 tags: self.__unsafe_private_named.10, 4776 title: self.__unsafe_private_named.11, 4777 uri: self.__unsafe_private_named.12.unwrap(), 4778 viewer_bookmark: self.__unsafe_private_named.13, 4779 viewer_like: self.__unsafe_private_named.14, 4780 viewer_reading_progress: self.__unsafe_private_named.15, 4781 viewer_subscription: self.__unsafe_private_named.16, 4782 extra_data: Default::default(), 4783 } 4784 } 4785 /// Build the final struct with custom extra_data 4786 pub fn build_with_data( 4787 self, 4788 extra_data: std::collections::BTreeMap< 4789 jacquard_common::smol_str::SmolStr, 4790 jacquard_common::types::value::Data<'a>, 4791 >, 4792 ) -> NotebookView<'a> { 4793 NotebookView { 4794 authors: self.__unsafe_private_named.0.unwrap(), 4795 bookmark_count: self.__unsafe_private_named.1, 4796 cid: self.__unsafe_private_named.2.unwrap(), 4797 entry_count: self.__unsafe_private_named.3, 4798 indexed_at: self.__unsafe_private_named.4.unwrap(), 4799 like_count: self.__unsafe_private_named.5, 4800 path: self.__unsafe_private_named.6, 4801 permissions: self.__unsafe_private_named.7, 4802 record: self.__unsafe_private_named.8.unwrap(), 4803 subscriber_count: self.__unsafe_private_named.9, 4804 tags: self.__unsafe_private_named.10, 4805 title: self.__unsafe_private_named.11, 4806 uri: self.__unsafe_private_named.12.unwrap(), 4807 viewer_bookmark: self.__unsafe_private_named.13, 4808 viewer_like: self.__unsafe_private_named.14, 4809 viewer_reading_progress: self.__unsafe_private_named.15, 4810 viewer_subscription: self.__unsafe_private_named.16, 4811 extra_data: Some(extra_data), 4812 } 4813 } 4814} 4815 4816impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { 4817 fn nsid() -> &'static str { 4818 "sh.weaver.notebook.defs" 4819 } 4820 fn def_name() -> &'static str { 4821 "notebookView" 4822 } 4823 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 4824 lexicon_doc_sh_weaver_notebook_defs() 4825 } 4826 fn validate( 4827 &self, 4828 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 4829 Ok(()) 4830 } 4831} 4832 4833/// Hydrated view of a page (entries displayed together). 4834#[jacquard_derive::lexicon] 4835#[derive( 4836 serde::Serialize, 4837 serde::Deserialize, 4838 Debug, 4839 Clone, 4840 PartialEq, 4841 Eq, 4842 jacquard_derive::IntoStatic 4843)] 4844#[serde(rename_all = "camelCase")] 4845pub struct PageView<'a> { 4846 #[serde(borrow)] 4847 pub cid: jacquard_common::types::string::Cid<'a>, 4848 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4849 pub entry_count: std::option::Option<i64>, 4850 pub indexed_at: jacquard_common::types::string::Datetime, 4851 #[serde(borrow)] 4852 pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, 4853 #[serde(borrow)] 4854 pub record: jacquard_common::types::value::Data<'a>, 4855 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4856 #[serde(borrow)] 4857 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 4858 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4859 #[serde(borrow)] 4860 pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>, 4861 #[serde(borrow)] 4862 pub uri: jacquard_common::types::string::AtUri<'a>, 4863} 4864 4865pub mod page_view_state { 4866 4867 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 4868 #[allow(unused)] 4869 use ::core::marker::PhantomData; 4870 mod sealed { 4871 pub trait Sealed {} 4872 } 4873 /// State trait tracking which required fields have been set 4874 pub trait State: sealed::Sealed { 4875 type Notebook; 4876 type Uri; 4877 type IndexedAt; 4878 type Cid; 4879 type Record; 4880 } 4881 /// Empty state - all required fields are unset 4882 pub struct Empty(()); 4883 impl sealed::Sealed for Empty {} 4884 impl State for Empty { 4885 type Notebook = Unset; 4886 type Uri = Unset; 4887 type IndexedAt = Unset; 4888 type Cid = Unset; 4889 type Record = Unset; 4890 } 4891 ///State transition - sets the `notebook` field to Set 4892 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 4893 impl<S: State> sealed::Sealed for SetNotebook<S> {} 4894 impl<S: State> State for SetNotebook<S> { 4895 type Notebook = Set<members::notebook>; 4896 type Uri = S::Uri; 4897 type IndexedAt = S::IndexedAt; 4898 type Cid = S::Cid; 4899 type Record = S::Record; 4900 } 4901 ///State transition - sets the `uri` field to Set 4902 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 4903 impl<S: State> sealed::Sealed for SetUri<S> {} 4904 impl<S: State> State for SetUri<S> { 4905 type Notebook = S::Notebook; 4906 type Uri = Set<members::uri>; 4907 type IndexedAt = S::IndexedAt; 4908 type Cid = S::Cid; 4909 type Record = S::Record; 4910 } 4911 ///State transition - sets the `indexed_at` field to Set 4912 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 4913 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 4914 impl<S: State> State for SetIndexedAt<S> { 4915 type Notebook = S::Notebook; 4916 type Uri = S::Uri; 4917 type IndexedAt = Set<members::indexed_at>; 4918 type Cid = S::Cid; 4919 type Record = S::Record; 4920 } 4921 ///State transition - sets the `cid` field to Set 4922 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 4923 impl<S: State> sealed::Sealed for SetCid<S> {} 4924 impl<S: State> State for SetCid<S> { 4925 type Notebook = S::Notebook; 4926 type Uri = S::Uri; 4927 type IndexedAt = S::IndexedAt; 4928 type Cid = Set<members::cid>; 4929 type Record = S::Record; 4930 } 4931 ///State transition - sets the `record` field to Set 4932 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 4933 impl<S: State> sealed::Sealed for SetRecord<S> {} 4934 impl<S: State> State for SetRecord<S> { 4935 type Notebook = S::Notebook; 4936 type Uri = S::Uri; 4937 type IndexedAt = S::IndexedAt; 4938 type Cid = S::Cid; 4939 type Record = Set<members::record>; 4940 } 4941 /// Marker types for field names 4942 #[allow(non_camel_case_types)] 4943 pub mod members { 4944 ///Marker type for the `notebook` field 4945 pub struct notebook(()); 4946 ///Marker type for the `uri` field 4947 pub struct uri(()); 4948 ///Marker type for the `indexed_at` field 4949 pub struct indexed_at(()); 4950 ///Marker type for the `cid` field 4951 pub struct cid(()); 4952 ///Marker type for the `record` field 4953 pub struct record(()); 4954 } 4955} 4956 4957/// Builder for constructing an instance of this type 4958pub struct PageViewBuilder<'a, S: page_view_state::State> { 4959 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 4960 __unsafe_private_named: ( 4961 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 4962 ::core::option::Option<i64>, 4963 ::core::option::Option<jacquard_common::types::string::Datetime>, 4964 ::core::option::Option<crate::sh_weaver::notebook::NotebookView<'a>>, 4965 ::core::option::Option<jacquard_common::types::value::Data<'a>>, 4966 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>, 4967 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>, 4968 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 4969 ), 4970 _phantom: ::core::marker::PhantomData<&'a ()>, 4971} 4972 4973impl<'a> PageView<'a> { 4974 /// Create a new builder for this type 4975 pub fn new() -> PageViewBuilder<'a, page_view_state::Empty> { 4976 PageViewBuilder::new() 4977 } 4978} 4979 4980impl<'a> PageViewBuilder<'a, page_view_state::Empty> { 4981 /// Create a new builder with all fields unset 4982 pub fn new() -> Self { 4983 PageViewBuilder { 4984 _phantom_state: ::core::marker::PhantomData, 4985 __unsafe_private_named: (None, None, None, None, None, None, None, None), 4986 _phantom: ::core::marker::PhantomData, 4987 } 4988 } 4989} 4990 4991impl<'a, S> PageViewBuilder<'a, S> 4992where 4993 S: page_view_state::State, 4994 S::Cid: page_view_state::IsUnset, 4995{ 4996 /// Set the `cid` field (required) 4997 pub fn cid( 4998 mut self, 4999 value: impl Into<jacquard_common::types::string::Cid<'a>>, 5000 ) -> PageViewBuilder<'a, page_view_state::SetCid<S>> { 5001 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 5002 PageViewBuilder { 5003 _phantom_state: ::core::marker::PhantomData, 5004 __unsafe_private_named: self.__unsafe_private_named, 5005 _phantom: ::core::marker::PhantomData, 5006 } 5007 } 5008} 5009 5010impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { 5011 /// Set the `entryCount` field (optional) 5012 pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self { 5013 self.__unsafe_private_named.1 = value.into(); 5014 self 5015 } 5016 /// Set the `entryCount` field to an Option value (optional) 5017 pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self { 5018 self.__unsafe_private_named.1 = value; 5019 self 5020 } 5021} 5022 5023impl<'a, S> PageViewBuilder<'a, S> 5024where 5025 S: page_view_state::State, 5026 S::IndexedAt: page_view_state::IsUnset, 5027{ 5028 /// Set the `indexedAt` field (required) 5029 pub fn indexed_at( 5030 mut self, 5031 value: impl Into<jacquard_common::types::string::Datetime>, 5032 ) -> PageViewBuilder<'a, page_view_state::SetIndexedAt<S>> { 5033 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 5034 PageViewBuilder { 5035 _phantom_state: ::core::marker::PhantomData, 5036 __unsafe_private_named: self.__unsafe_private_named, 5037 _phantom: ::core::marker::PhantomData, 5038 } 5039 } 5040} 5041 5042impl<'a, S> PageViewBuilder<'a, S> 5043where 5044 S: page_view_state::State, 5045 S::Notebook: page_view_state::IsUnset, 5046{ 5047 /// Set the `notebook` field (required) 5048 pub fn notebook( 5049 mut self, 5050 value: impl Into<crate::sh_weaver::notebook::NotebookView<'a>>, 5051 ) -> PageViewBuilder<'a, page_view_state::SetNotebook<S>> { 5052 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 5053 PageViewBuilder { 5054 _phantom_state: ::core::marker::PhantomData, 5055 __unsafe_private_named: self.__unsafe_private_named, 5056 _phantom: ::core::marker::PhantomData, 5057 } 5058 } 5059} 5060 5061impl<'a, S> PageViewBuilder<'a, S> 5062where 5063 S: page_view_state::State, 5064 S::Record: page_view_state::IsUnset, 5065{ 5066 /// Set the `record` field (required) 5067 pub fn record( 5068 mut self, 5069 value: impl Into<jacquard_common::types::value::Data<'a>>, 5070 ) -> PageViewBuilder<'a, page_view_state::SetRecord<S>> { 5071 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 5072 PageViewBuilder { 5073 _phantom_state: ::core::marker::PhantomData, 5074 __unsafe_private_named: self.__unsafe_private_named, 5075 _phantom: ::core::marker::PhantomData, 5076 } 5077 } 5078} 5079 5080impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { 5081 /// Set the `tags` field (optional) 5082 pub fn tags( 5083 mut self, 5084 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>, 5085 ) -> Self { 5086 self.__unsafe_private_named.5 = value.into(); 5087 self 5088 } 5089 /// Set the `tags` field to an Option value (optional) 5090 pub fn maybe_tags( 5091 mut self, 5092 value: Option<crate::sh_weaver::notebook::Tags<'a>>, 5093 ) -> Self { 5094 self.__unsafe_private_named.5 = value; 5095 self 5096 } 5097} 5098 5099impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { 5100 /// Set the `title` field (optional) 5101 pub fn title( 5102 mut self, 5103 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>, 5104 ) -> Self { 5105 self.__unsafe_private_named.6 = value.into(); 5106 self 5107 } 5108 /// Set the `title` field to an Option value (optional) 5109 pub fn maybe_title( 5110 mut self, 5111 value: Option<crate::sh_weaver::notebook::Title<'a>>, 5112 ) -> Self { 5113 self.__unsafe_private_named.6 = value; 5114 self 5115 } 5116} 5117 5118impl<'a, S> PageViewBuilder<'a, S> 5119where 5120 S: page_view_state::State, 5121 S::Uri: page_view_state::IsUnset, 5122{ 5123 /// Set the `uri` field (required) 5124 pub fn uri( 5125 mut self, 5126 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 5127 ) -> PageViewBuilder<'a, page_view_state::SetUri<S>> { 5128 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 5129 PageViewBuilder { 5130 _phantom_state: ::core::marker::PhantomData, 5131 __unsafe_private_named: self.__unsafe_private_named, 5132 _phantom: ::core::marker::PhantomData, 5133 } 5134 } 5135} 5136 5137impl<'a, S> PageViewBuilder<'a, S> 5138where 5139 S: page_view_state::State, 5140 S::Notebook: page_view_state::IsSet, 5141 S::Uri: page_view_state::IsSet, 5142 S::IndexedAt: page_view_state::IsSet, 5143 S::Cid: page_view_state::IsSet, 5144 S::Record: page_view_state::IsSet, 5145{ 5146 /// Build the final struct 5147 pub fn build(self) -> PageView<'a> { 5148 PageView { 5149 cid: self.__unsafe_private_named.0.unwrap(), 5150 entry_count: self.__unsafe_private_named.1, 5151 indexed_at: self.__unsafe_private_named.2.unwrap(), 5152 notebook: self.__unsafe_private_named.3.unwrap(), 5153 record: self.__unsafe_private_named.4.unwrap(), 5154 tags: self.__unsafe_private_named.5, 5155 title: self.__unsafe_private_named.6, 5156 uri: self.__unsafe_private_named.7.unwrap(), 5157 extra_data: Default::default(), 5158 } 5159 } 5160 /// Build the final struct with custom extra_data 5161 pub fn build_with_data( 5162 self, 5163 extra_data: std::collections::BTreeMap< 5164 jacquard_common::smol_str::SmolStr, 5165 jacquard_common::types::value::Data<'a>, 5166 >, 5167 ) -> PageView<'a> { 5168 PageView { 5169 cid: self.__unsafe_private_named.0.unwrap(), 5170 entry_count: self.__unsafe_private_named.1, 5171 indexed_at: self.__unsafe_private_named.2.unwrap(), 5172 notebook: self.__unsafe_private_named.3.unwrap(), 5173 record: self.__unsafe_private_named.4.unwrap(), 5174 tags: self.__unsafe_private_named.5, 5175 title: self.__unsafe_private_named.6, 5176 uri: self.__unsafe_private_named.7.unwrap(), 5177 extra_data: Some(extra_data), 5178 } 5179 } 5180} 5181 5182impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PageView<'a> { 5183 fn nsid() -> &'static str { 5184 "sh.weaver.notebook.defs" 5185 } 5186 fn def_name() -> &'static str { 5187 "pageView" 5188 } 5189 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 5190 lexicon_doc_sh_weaver_notebook_defs() 5191 } 5192 fn validate( 5193 &self, 5194 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 5195 Ok(()) 5196 } 5197} 5198 5199/// The path of the notebook. 5200pub type Path<'a> = jacquard_common::CowStr<'a>; 5201/// A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt. 5202#[jacquard_derive::lexicon] 5203#[derive( 5204 serde::Serialize, 5205 serde::Deserialize, 5206 Debug, 5207 Clone, 5208 PartialEq, 5209 Eq, 5210 jacquard_derive::IntoStatic 5211)] 5212#[serde(rename_all = "camelCase")] 5213pub struct PermissionGrant<'a> { 5214 #[serde(borrow)] 5215 pub did: jacquard_common::types::string::Did<'a>, 5216 /// For authority: record createdAt. For invitees: accept createdAt 5217 pub granted_at: jacquard_common::types::string::Datetime, 5218 /// direct = this resource (includes authority), inherited = via notebook invite 5219 #[serde(borrow)] 5220 pub scope: PermissionGrantScope<'a>, 5221 /// For authority: resource URI. For invitees: invite URI 5222 #[serde(borrow)] 5223 pub source: jacquard_common::types::string::AtUri<'a>, 5224} 5225 5226pub mod permission_grant_state { 5227 5228 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 5229 #[allow(unused)] 5230 use ::core::marker::PhantomData; 5231 mod sealed { 5232 pub trait Sealed {} 5233 } 5234 /// State trait tracking which required fields have been set 5235 pub trait State: sealed::Sealed { 5236 type Scope; 5237 type Did; 5238 type Source; 5239 type GrantedAt; 5240 } 5241 /// Empty state - all required fields are unset 5242 pub struct Empty(()); 5243 impl sealed::Sealed for Empty {} 5244 impl State for Empty { 5245 type Scope = Unset; 5246 type Did = Unset; 5247 type Source = Unset; 5248 type GrantedAt = Unset; 5249 } 5250 ///State transition - sets the `scope` field to Set 5251 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>); 5252 impl<S: State> sealed::Sealed for SetScope<S> {} 5253 impl<S: State> State for SetScope<S> { 5254 type Scope = Set<members::scope>; 5255 type Did = S::Did; 5256 type Source = S::Source; 5257 type GrantedAt = S::GrantedAt; 5258 } 5259 ///State transition - sets the `did` field to Set 5260 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 5261 impl<S: State> sealed::Sealed for SetDid<S> {} 5262 impl<S: State> State for SetDid<S> { 5263 type Scope = S::Scope; 5264 type Did = Set<members::did>; 5265 type Source = S::Source; 5266 type GrantedAt = S::GrantedAt; 5267 } 5268 ///State transition - sets the `source` field to Set 5269 pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 5270 impl<S: State> sealed::Sealed for SetSource<S> {} 5271 impl<S: State> State for SetSource<S> { 5272 type Scope = S::Scope; 5273 type Did = S::Did; 5274 type Source = Set<members::source>; 5275 type GrantedAt = S::GrantedAt; 5276 } 5277 ///State transition - sets the `granted_at` field to Set 5278 pub struct SetGrantedAt<S: State = Empty>(PhantomData<fn() -> S>); 5279 impl<S: State> sealed::Sealed for SetGrantedAt<S> {} 5280 impl<S: State> State for SetGrantedAt<S> { 5281 type Scope = S::Scope; 5282 type Did = S::Did; 5283 type Source = S::Source; 5284 type GrantedAt = Set<members::granted_at>; 5285 } 5286 /// Marker types for field names 5287 #[allow(non_camel_case_types)] 5288 pub mod members { 5289 ///Marker type for the `scope` field 5290 pub struct scope(()); 5291 ///Marker type for the `did` field 5292 pub struct did(()); 5293 ///Marker type for the `source` field 5294 pub struct source(()); 5295 ///Marker type for the `granted_at` field 5296 pub struct granted_at(()); 5297 } 5298} 5299 5300/// Builder for constructing an instance of this type 5301pub struct PermissionGrantBuilder<'a, S: permission_grant_state::State> { 5302 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 5303 __unsafe_private_named: ( 5304 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 5305 ::core::option::Option<jacquard_common::types::string::Datetime>, 5306 ::core::option::Option<PermissionGrantScope<'a>>, 5307 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 5308 ), 5309 _phantom: ::core::marker::PhantomData<&'a ()>, 5310} 5311 5312impl<'a> PermissionGrant<'a> { 5313 /// Create a new builder for this type 5314 pub fn new() -> PermissionGrantBuilder<'a, permission_grant_state::Empty> { 5315 PermissionGrantBuilder::new() 5316 } 5317} 5318 5319impl<'a> PermissionGrantBuilder<'a, permission_grant_state::Empty> { 5320 /// Create a new builder with all fields unset 5321 pub fn new() -> Self { 5322 PermissionGrantBuilder { 5323 _phantom_state: ::core::marker::PhantomData, 5324 __unsafe_private_named: (None, None, None, None), 5325 _phantom: ::core::marker::PhantomData, 5326 } 5327 } 5328} 5329 5330impl<'a, S> PermissionGrantBuilder<'a, S> 5331where 5332 S: permission_grant_state::State, 5333 S::Did: permission_grant_state::IsUnset, 5334{ 5335 /// Set the `did` field (required) 5336 pub fn did( 5337 mut self, 5338 value: impl Into<jacquard_common::types::string::Did<'a>>, 5339 ) -> PermissionGrantBuilder<'a, permission_grant_state::SetDid<S>> { 5340 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 5341 PermissionGrantBuilder { 5342 _phantom_state: ::core::marker::PhantomData, 5343 __unsafe_private_named: self.__unsafe_private_named, 5344 _phantom: ::core::marker::PhantomData, 5345 } 5346 } 5347} 5348 5349impl<'a, S> PermissionGrantBuilder<'a, S> 5350where 5351 S: permission_grant_state::State, 5352 S::GrantedAt: permission_grant_state::IsUnset, 5353{ 5354 /// Set the `grantedAt` field (required) 5355 pub fn granted_at( 5356 mut self, 5357 value: impl Into<jacquard_common::types::string::Datetime>, 5358 ) -> PermissionGrantBuilder<'a, permission_grant_state::SetGrantedAt<S>> { 5359 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 5360 PermissionGrantBuilder { 5361 _phantom_state: ::core::marker::PhantomData, 5362 __unsafe_private_named: self.__unsafe_private_named, 5363 _phantom: ::core::marker::PhantomData, 5364 } 5365 } 5366} 5367 5368impl<'a, S> PermissionGrantBuilder<'a, S> 5369where 5370 S: permission_grant_state::State, 5371 S::Scope: permission_grant_state::IsUnset, 5372{ 5373 /// Set the `scope` field (required) 5374 pub fn scope( 5375 mut self, 5376 value: impl Into<PermissionGrantScope<'a>>, 5377 ) -> PermissionGrantBuilder<'a, permission_grant_state::SetScope<S>> { 5378 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 5379 PermissionGrantBuilder { 5380 _phantom_state: ::core::marker::PhantomData, 5381 __unsafe_private_named: self.__unsafe_private_named, 5382 _phantom: ::core::marker::PhantomData, 5383 } 5384 } 5385} 5386 5387impl<'a, S> PermissionGrantBuilder<'a, S> 5388where 5389 S: permission_grant_state::State, 5390 S::Source: permission_grant_state::IsUnset, 5391{ 5392 /// Set the `source` field (required) 5393 pub fn source( 5394 mut self, 5395 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 5396 ) -> PermissionGrantBuilder<'a, permission_grant_state::SetSource<S>> { 5397 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 5398 PermissionGrantBuilder { 5399 _phantom_state: ::core::marker::PhantomData, 5400 __unsafe_private_named: self.__unsafe_private_named, 5401 _phantom: ::core::marker::PhantomData, 5402 } 5403 } 5404} 5405 5406impl<'a, S> PermissionGrantBuilder<'a, S> 5407where 5408 S: permission_grant_state::State, 5409 S::Scope: permission_grant_state::IsSet, 5410 S::Did: permission_grant_state::IsSet, 5411 S::Source: permission_grant_state::IsSet, 5412 S::GrantedAt: permission_grant_state::IsSet, 5413{ 5414 /// Build the final struct 5415 pub fn build(self) -> PermissionGrant<'a> { 5416 PermissionGrant { 5417 did: self.__unsafe_private_named.0.unwrap(), 5418 granted_at: self.__unsafe_private_named.1.unwrap(), 5419 scope: self.__unsafe_private_named.2.unwrap(), 5420 source: self.__unsafe_private_named.3.unwrap(), 5421 extra_data: Default::default(), 5422 } 5423 } 5424 /// Build the final struct with custom extra_data 5425 pub fn build_with_data( 5426 self, 5427 extra_data: std::collections::BTreeMap< 5428 jacquard_common::smol_str::SmolStr, 5429 jacquard_common::types::value::Data<'a>, 5430 >, 5431 ) -> PermissionGrant<'a> { 5432 PermissionGrant { 5433 did: self.__unsafe_private_named.0.unwrap(), 5434 granted_at: self.__unsafe_private_named.1.unwrap(), 5435 scope: self.__unsafe_private_named.2.unwrap(), 5436 source: self.__unsafe_private_named.3.unwrap(), 5437 extra_data: Some(extra_data), 5438 } 5439 } 5440} 5441 5442/// direct = this resource (includes authority), inherited = via notebook invite 5443#[derive(Debug, Clone, PartialEq, Eq, Hash)] 5444pub enum PermissionGrantScope<'a> { 5445 Direct, 5446 Inherited, 5447 Other(jacquard_common::CowStr<'a>), 5448} 5449 5450impl<'a> PermissionGrantScope<'a> { 5451 pub fn as_str(&self) -> &str { 5452 match self { 5453 Self::Direct => "direct", 5454 Self::Inherited => "inherited", 5455 Self::Other(s) => s.as_ref(), 5456 } 5457 } 5458} 5459 5460impl<'a> From<&'a str> for PermissionGrantScope<'a> { 5461 fn from(s: &'a str) -> Self { 5462 match s { 5463 "direct" => Self::Direct, 5464 "inherited" => Self::Inherited, 5465 _ => Self::Other(jacquard_common::CowStr::from(s)), 5466 } 5467 } 5468} 5469 5470impl<'a> From<String> for PermissionGrantScope<'a> { 5471 fn from(s: String) -> Self { 5472 match s.as_str() { 5473 "direct" => Self::Direct, 5474 "inherited" => Self::Inherited, 5475 _ => Self::Other(jacquard_common::CowStr::from(s)), 5476 } 5477 } 5478} 5479 5480impl<'a> core::fmt::Display for PermissionGrantScope<'a> { 5481 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 5482 write!(f, "{}", self.as_str()) 5483 } 5484} 5485 5486impl<'a> AsRef<str> for PermissionGrantScope<'a> { 5487 fn as_ref(&self) -> &str { 5488 self.as_str() 5489 } 5490} 5491 5492impl<'a> serde::Serialize for PermissionGrantScope<'a> { 5493 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 5494 where 5495 S: serde::Serializer, 5496 { 5497 serializer.serialize_str(self.as_str()) 5498 } 5499} 5500 5501impl<'de, 'a> serde::Deserialize<'de> for PermissionGrantScope<'a> 5502where 5503 'de: 'a, 5504{ 5505 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 5506 where 5507 D: serde::Deserializer<'de>, 5508 { 5509 let s = <&'de str>::deserialize(deserializer)?; 5510 Ok(Self::from(s)) 5511 } 5512} 5513 5514impl<'a> Default for PermissionGrantScope<'a> { 5515 fn default() -> Self { 5516 Self::Other(Default::default()) 5517 } 5518} 5519 5520impl jacquard_common::IntoStatic for PermissionGrantScope<'_> { 5521 type Output = PermissionGrantScope<'static>; 5522 fn into_static(self) -> Self::Output { 5523 match self { 5524 PermissionGrantScope::Direct => PermissionGrantScope::Direct, 5525 PermissionGrantScope::Inherited => PermissionGrantScope::Inherited, 5526 PermissionGrantScope::Other(v) => { 5527 PermissionGrantScope::Other(v.into_static()) 5528 } 5529 } 5530 } 5531} 5532 5533impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> { 5534 fn nsid() -> &'static str { 5535 "sh.weaver.notebook.defs" 5536 } 5537 fn def_name() -> &'static str { 5538 "permissionGrant" 5539 } 5540 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 5541 lexicon_doc_sh_weaver_notebook_defs() 5542 } 5543 fn validate( 5544 &self, 5545 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 5546 Ok(()) 5547 } 5548} 5549 5550/// ACL-style permissions for a resource. Separate from authors (who contributed). 5551#[jacquard_derive::lexicon] 5552#[derive( 5553 serde::Serialize, 5554 serde::Deserialize, 5555 Debug, 5556 Clone, 5557 PartialEq, 5558 Eq, 5559 jacquard_derive::IntoStatic 5560)] 5561#[serde(rename_all = "camelCase")] 5562pub struct PermissionsState<'a> { 5563 /// DIDs that can edit this resource 5564 #[serde(borrow)] 5565 pub editors: Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>, 5566 /// DIDs that can view (future use) 5567 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5568 #[serde(borrow)] 5569 pub viewers: std::option::Option< 5570 Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>, 5571 >, 5572} 5573 5574pub mod permissions_state_state { 5575 5576 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 5577 #[allow(unused)] 5578 use ::core::marker::PhantomData; 5579 mod sealed { 5580 pub trait Sealed {} 5581 } 5582 /// State trait tracking which required fields have been set 5583 pub trait State: sealed::Sealed { 5584 type Editors; 5585 } 5586 /// Empty state - all required fields are unset 5587 pub struct Empty(()); 5588 impl sealed::Sealed for Empty {} 5589 impl State for Empty { 5590 type Editors = Unset; 5591 } 5592 ///State transition - sets the `editors` field to Set 5593 pub struct SetEditors<S: State = Empty>(PhantomData<fn() -> S>); 5594 impl<S: State> sealed::Sealed for SetEditors<S> {} 5595 impl<S: State> State for SetEditors<S> { 5596 type Editors = Set<members::editors>; 5597 } 5598 /// Marker types for field names 5599 #[allow(non_camel_case_types)] 5600 pub mod members { 5601 ///Marker type for the `editors` field 5602 pub struct editors(()); 5603 } 5604} 5605 5606/// Builder for constructing an instance of this type 5607pub struct PermissionsStateBuilder<'a, S: permissions_state_state::State> { 5608 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 5609 __unsafe_private_named: ( 5610 ::core::option::Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>, 5611 ::core::option::Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>, 5612 ), 5613 _phantom: ::core::marker::PhantomData<&'a ()>, 5614} 5615 5616impl<'a> PermissionsState<'a> { 5617 /// Create a new builder for this type 5618 pub fn new() -> PermissionsStateBuilder<'a, permissions_state_state::Empty> { 5619 PermissionsStateBuilder::new() 5620 } 5621} 5622 5623impl<'a> PermissionsStateBuilder<'a, permissions_state_state::Empty> { 5624 /// Create a new builder with all fields unset 5625 pub fn new() -> Self { 5626 PermissionsStateBuilder { 5627 _phantom_state: ::core::marker::PhantomData, 5628 __unsafe_private_named: (None, None), 5629 _phantom: ::core::marker::PhantomData, 5630 } 5631 } 5632} 5633 5634impl<'a, S> PermissionsStateBuilder<'a, S> 5635where 5636 S: permissions_state_state::State, 5637 S::Editors: permissions_state_state::IsUnset, 5638{ 5639 /// Set the `editors` field (required) 5640 pub fn editors( 5641 mut self, 5642 value: impl Into<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>, 5643 ) -> PermissionsStateBuilder<'a, permissions_state_state::SetEditors<S>> { 5644 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 5645 PermissionsStateBuilder { 5646 _phantom_state: ::core::marker::PhantomData, 5647 __unsafe_private_named: self.__unsafe_private_named, 5648 _phantom: ::core::marker::PhantomData, 5649 } 5650 } 5651} 5652 5653impl<'a, S: permissions_state_state::State> PermissionsStateBuilder<'a, S> { 5654 /// Set the `viewers` field (optional) 5655 pub fn viewers( 5656 mut self, 5657 value: impl Into<Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>>, 5658 ) -> Self { 5659 self.__unsafe_private_named.1 = value.into(); 5660 self 5661 } 5662 /// Set the `viewers` field to an Option value (optional) 5663 pub fn maybe_viewers( 5664 mut self, 5665 value: Option<Vec<crate::sh_weaver::notebook::PermissionGrant<'a>>>, 5666 ) -> Self { 5667 self.__unsafe_private_named.1 = value; 5668 self 5669 } 5670} 5671 5672impl<'a, S> PermissionsStateBuilder<'a, S> 5673where 5674 S: permissions_state_state::State, 5675 S::Editors: permissions_state_state::IsSet, 5676{ 5677 /// Build the final struct 5678 pub fn build(self) -> PermissionsState<'a> { 5679 PermissionsState { 5680 editors: self.__unsafe_private_named.0.unwrap(), 5681 viewers: self.__unsafe_private_named.1, 5682 extra_data: Default::default(), 5683 } 5684 } 5685 /// Build the final struct with custom extra_data 5686 pub fn build_with_data( 5687 self, 5688 extra_data: std::collections::BTreeMap< 5689 jacquard_common::smol_str::SmolStr, 5690 jacquard_common::types::value::Data<'a>, 5691 >, 5692 ) -> PermissionsState<'a> { 5693 PermissionsState { 5694 editors: self.__unsafe_private_named.0.unwrap(), 5695 viewers: self.__unsafe_private_named.1, 5696 extra_data: Some(extra_data), 5697 } 5698 } 5699} 5700 5701impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> { 5702 fn nsid() -> &'static str { 5703 "sh.weaver.notebook.defs" 5704 } 5705 fn def_name() -> &'static str { 5706 "permissionsState" 5707 } 5708 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 5709 lexicon_doc_sh_weaver_notebook_defs() 5710 } 5711 fn validate( 5712 &self, 5713 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 5714 Ok(()) 5715 } 5716} 5717 5718/// A published version of an entry in a collaborator's repo. 5719#[jacquard_derive::lexicon] 5720#[derive( 5721 serde::Serialize, 5722 serde::Deserialize, 5723 Debug, 5724 Clone, 5725 PartialEq, 5726 Eq, 5727 jacquard_derive::IntoStatic 5728)] 5729#[serde(rename_all = "camelCase")] 5730pub struct PublishedVersionView<'a> { 5731 #[serde(borrow)] 5732 pub cid: jacquard_common::types::string::Cid<'a>, 5733 /// If content differs, the version it diverged from 5734 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5735 #[serde(borrow)] 5736 pub diverged_from: std::option::Option< 5737 crate::com_atproto::repo::strong_ref::StrongRef<'a>, 5738 >, 5739 /// True if this is the 'primary' version (owner's repo) 5740 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5741 pub is_canonical: std::option::Option<bool>, 5742 pub published_at: jacquard_common::types::string::Datetime, 5743 #[serde(borrow)] 5744 pub publisher: crate::sh_weaver::actor::ProfileViewBasic<'a>, 5745 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5746 pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>, 5747 #[serde(borrow)] 5748 pub uri: jacquard_common::types::string::AtUri<'a>, 5749} 5750 5751pub mod published_version_view_state { 5752 5753 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 5754 #[allow(unused)] 5755 use ::core::marker::PhantomData; 5756 mod sealed { 5757 pub trait Sealed {} 5758 } 5759 /// State trait tracking which required fields have been set 5760 pub trait State: sealed::Sealed { 5761 type Cid; 5762 type Publisher; 5763 type Uri; 5764 type PublishedAt; 5765 } 5766 /// Empty state - all required fields are unset 5767 pub struct Empty(()); 5768 impl sealed::Sealed for Empty {} 5769 impl State for Empty { 5770 type Cid = Unset; 5771 type Publisher = Unset; 5772 type Uri = Unset; 5773 type PublishedAt = Unset; 5774 } 5775 ///State transition - sets the `cid` field to Set 5776 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>); 5777 impl<S: State> sealed::Sealed for SetCid<S> {} 5778 impl<S: State> State for SetCid<S> { 5779 type Cid = Set<members::cid>; 5780 type Publisher = S::Publisher; 5781 type Uri = S::Uri; 5782 type PublishedAt = S::PublishedAt; 5783 } 5784 ///State transition - sets the `publisher` field to Set 5785 pub struct SetPublisher<S: State = Empty>(PhantomData<fn() -> S>); 5786 impl<S: State> sealed::Sealed for SetPublisher<S> {} 5787 impl<S: State> State for SetPublisher<S> { 5788 type Cid = S::Cid; 5789 type Publisher = Set<members::publisher>; 5790 type Uri = S::Uri; 5791 type PublishedAt = S::PublishedAt; 5792 } 5793 ///State transition - sets the `uri` field to Set 5794 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 5795 impl<S: State> sealed::Sealed for SetUri<S> {} 5796 impl<S: State> State for SetUri<S> { 5797 type Cid = S::Cid; 5798 type Publisher = S::Publisher; 5799 type Uri = Set<members::uri>; 5800 type PublishedAt = S::PublishedAt; 5801 } 5802 ///State transition - sets the `published_at` field to Set 5803 pub struct SetPublishedAt<S: State = Empty>(PhantomData<fn() -> S>); 5804 impl<S: State> sealed::Sealed for SetPublishedAt<S> {} 5805 impl<S: State> State for SetPublishedAt<S> { 5806 type Cid = S::Cid; 5807 type Publisher = S::Publisher; 5808 type Uri = S::Uri; 5809 type PublishedAt = Set<members::published_at>; 5810 } 5811 /// Marker types for field names 5812 #[allow(non_camel_case_types)] 5813 pub mod members { 5814 ///Marker type for the `cid` field 5815 pub struct cid(()); 5816 ///Marker type for the `publisher` field 5817 pub struct publisher(()); 5818 ///Marker type for the `uri` field 5819 pub struct uri(()); 5820 ///Marker type for the `published_at` field 5821 pub struct published_at(()); 5822 } 5823} 5824 5825/// Builder for constructing an instance of this type 5826pub struct PublishedVersionViewBuilder<'a, S: published_version_view_state::State> { 5827 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 5828 __unsafe_private_named: ( 5829 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 5830 ::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 5831 ::core::option::Option<bool>, 5832 ::core::option::Option<jacquard_common::types::string::Datetime>, 5833 ::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 5834 ::core::option::Option<jacquard_common::types::string::Datetime>, 5835 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 5836 ), 5837 _phantom: ::core::marker::PhantomData<&'a ()>, 5838} 5839 5840impl<'a> PublishedVersionView<'a> { 5841 /// Create a new builder for this type 5842 pub fn new() -> PublishedVersionViewBuilder< 5843 'a, 5844 published_version_view_state::Empty, 5845 > { 5846 PublishedVersionViewBuilder::new() 5847 } 5848} 5849 5850impl<'a> PublishedVersionViewBuilder<'a, published_version_view_state::Empty> { 5851 /// Create a new builder with all fields unset 5852 pub fn new() -> Self { 5853 PublishedVersionViewBuilder { 5854 _phantom_state: ::core::marker::PhantomData, 5855 __unsafe_private_named: (None, None, None, None, None, None, None), 5856 _phantom: ::core::marker::PhantomData, 5857 } 5858 } 5859} 5860 5861impl<'a, S> PublishedVersionViewBuilder<'a, S> 5862where 5863 S: published_version_view_state::State, 5864 S::Cid: published_version_view_state::IsUnset, 5865{ 5866 /// Set the `cid` field (required) 5867 pub fn cid( 5868 mut self, 5869 value: impl Into<jacquard_common::types::string::Cid<'a>>, 5870 ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetCid<S>> { 5871 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 5872 PublishedVersionViewBuilder { 5873 _phantom_state: ::core::marker::PhantomData, 5874 __unsafe_private_named: self.__unsafe_private_named, 5875 _phantom: ::core::marker::PhantomData, 5876 } 5877 } 5878} 5879 5880impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { 5881 /// Set the `divergedFrom` field (optional) 5882 pub fn diverged_from( 5883 mut self, 5884 value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 5885 ) -> Self { 5886 self.__unsafe_private_named.1 = value.into(); 5887 self 5888 } 5889 /// Set the `divergedFrom` field to an Option value (optional) 5890 pub fn maybe_diverged_from( 5891 mut self, 5892 value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 5893 ) -> Self { 5894 self.__unsafe_private_named.1 = value; 5895 self 5896 } 5897} 5898 5899impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { 5900 /// Set the `isCanonical` field (optional) 5901 pub fn is_canonical(mut self, value: impl Into<Option<bool>>) -> Self { 5902 self.__unsafe_private_named.2 = value.into(); 5903 self 5904 } 5905 /// Set the `isCanonical` field to an Option value (optional) 5906 pub fn maybe_is_canonical(mut self, value: Option<bool>) -> Self { 5907 self.__unsafe_private_named.2 = value; 5908 self 5909 } 5910} 5911 5912impl<'a, S> PublishedVersionViewBuilder<'a, S> 5913where 5914 S: published_version_view_state::State, 5915 S::PublishedAt: published_version_view_state::IsUnset, 5916{ 5917 /// Set the `publishedAt` field (required) 5918 pub fn published_at( 5919 mut self, 5920 value: impl Into<jacquard_common::types::string::Datetime>, 5921 ) -> PublishedVersionViewBuilder< 5922 'a, 5923 published_version_view_state::SetPublishedAt<S>, 5924 > { 5925 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 5926 PublishedVersionViewBuilder { 5927 _phantom_state: ::core::marker::PhantomData, 5928 __unsafe_private_named: self.__unsafe_private_named, 5929 _phantom: ::core::marker::PhantomData, 5930 } 5931 } 5932} 5933 5934impl<'a, S> PublishedVersionViewBuilder<'a, S> 5935where 5936 S: published_version_view_state::State, 5937 S::Publisher: published_version_view_state::IsUnset, 5938{ 5939 /// Set the `publisher` field (required) 5940 pub fn publisher( 5941 mut self, 5942 value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 5943 ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetPublisher<S>> { 5944 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 5945 PublishedVersionViewBuilder { 5946 _phantom_state: ::core::marker::PhantomData, 5947 __unsafe_private_named: self.__unsafe_private_named, 5948 _phantom: ::core::marker::PhantomData, 5949 } 5950 } 5951} 5952 5953impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { 5954 /// Set the `updatedAt` field (optional) 5955 pub fn updated_at( 5956 mut self, 5957 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 5958 ) -> Self { 5959 self.__unsafe_private_named.5 = value.into(); 5960 self 5961 } 5962 /// Set the `updatedAt` field to an Option value (optional) 5963 pub fn maybe_updated_at( 5964 mut self, 5965 value: Option<jacquard_common::types::string::Datetime>, 5966 ) -> Self { 5967 self.__unsafe_private_named.5 = value; 5968 self 5969 } 5970} 5971 5972impl<'a, S> PublishedVersionViewBuilder<'a, S> 5973where 5974 S: published_version_view_state::State, 5975 S::Uri: published_version_view_state::IsUnset, 5976{ 5977 /// Set the `uri` field (required) 5978 pub fn uri( 5979 mut self, 5980 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 5981 ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetUri<S>> { 5982 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 5983 PublishedVersionViewBuilder { 5984 _phantom_state: ::core::marker::PhantomData, 5985 __unsafe_private_named: self.__unsafe_private_named, 5986 _phantom: ::core::marker::PhantomData, 5987 } 5988 } 5989} 5990 5991impl<'a, S> PublishedVersionViewBuilder<'a, S> 5992where 5993 S: published_version_view_state::State, 5994 S::Cid: published_version_view_state::IsSet, 5995 S::Publisher: published_version_view_state::IsSet, 5996 S::Uri: published_version_view_state::IsSet, 5997 S::PublishedAt: published_version_view_state::IsSet, 5998{ 5999 /// Build the final struct 6000 pub fn build(self) -> PublishedVersionView<'a> { 6001 PublishedVersionView { 6002 cid: self.__unsafe_private_named.0.unwrap(), 6003 diverged_from: self.__unsafe_private_named.1, 6004 is_canonical: self.__unsafe_private_named.2, 6005 published_at: self.__unsafe_private_named.3.unwrap(), 6006 publisher: self.__unsafe_private_named.4.unwrap(), 6007 updated_at: self.__unsafe_private_named.5, 6008 uri: self.__unsafe_private_named.6.unwrap(), 6009 extra_data: Default::default(), 6010 } 6011 } 6012 /// Build the final struct with custom extra_data 6013 pub fn build_with_data( 6014 self, 6015 extra_data: std::collections::BTreeMap< 6016 jacquard_common::smol_str::SmolStr, 6017 jacquard_common::types::value::Data<'a>, 6018 >, 6019 ) -> PublishedVersionView<'a> { 6020 PublishedVersionView { 6021 cid: self.__unsafe_private_named.0.unwrap(), 6022 diverged_from: self.__unsafe_private_named.1, 6023 is_canonical: self.__unsafe_private_named.2, 6024 published_at: self.__unsafe_private_named.3.unwrap(), 6025 publisher: self.__unsafe_private_named.4.unwrap(), 6026 updated_at: self.__unsafe_private_named.5, 6027 uri: self.__unsafe_private_named.6.unwrap(), 6028 extra_data: Some(extra_data), 6029 } 6030 } 6031} 6032 6033impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublishedVersionView<'a> { 6034 fn nsid() -> &'static str { 6035 "sh.weaver.notebook.defs" 6036 } 6037 fn def_name() -> &'static str { 6038 "publishedVersionView" 6039 } 6040 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6041 lexicon_doc_sh_weaver_notebook_defs() 6042 } 6043 fn validate( 6044 &self, 6045 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6046 Ok(()) 6047 } 6048} 6049 6050/// Viewer's reading progress (appview-side state, not a record). 6051#[jacquard_derive::lexicon] 6052#[derive( 6053 serde::Serialize, 6054 serde::Deserialize, 6055 Debug, 6056 Clone, 6057 PartialEq, 6058 Eq, 6059 jacquard_derive::IntoStatic, 6060 Default 6061)] 6062#[serde(rename_all = "camelCase")] 6063pub struct ReadingProgress<'a> { 6064 /// Last entry the viewer was reading. 6065 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6066 #[serde(borrow)] 6067 pub current_entry: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 6068 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6069 pub finished_at: std::option::Option<jacquard_common::types::string::Datetime>, 6070 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6071 pub last_read_at: std::option::Option<jacquard_common::types::string::Datetime>, 6072 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6073 pub percent_complete: std::option::Option<i64>, 6074 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6075 pub started_at: std::option::Option<jacquard_common::types::string::Datetime>, 6076 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6077 #[serde(borrow)] 6078 pub status: std::option::Option<ReadingProgressStatus<'a>>, 6079} 6080 6081#[derive(Debug, Clone, PartialEq, Eq, Hash)] 6082pub enum ReadingProgressStatus<'a> { 6083 Reading, 6084 Finished, 6085 Abandoned, 6086 WantToRead, 6087 Other(jacquard_common::CowStr<'a>), 6088} 6089 6090impl<'a> ReadingProgressStatus<'a> { 6091 pub fn as_str(&self) -> &str { 6092 match self { 6093 Self::Reading => "reading", 6094 Self::Finished => "finished", 6095 Self::Abandoned => "abandoned", 6096 Self::WantToRead => "want-to-read", 6097 Self::Other(s) => s.as_ref(), 6098 } 6099 } 6100} 6101 6102impl<'a> From<&'a str> for ReadingProgressStatus<'a> { 6103 fn from(s: &'a str) -> Self { 6104 match s { 6105 "reading" => Self::Reading, 6106 "finished" => Self::Finished, 6107 "abandoned" => Self::Abandoned, 6108 "want-to-read" => Self::WantToRead, 6109 _ => Self::Other(jacquard_common::CowStr::from(s)), 6110 } 6111 } 6112} 6113 6114impl<'a> From<String> for ReadingProgressStatus<'a> { 6115 fn from(s: String) -> Self { 6116 match s.as_str() { 6117 "reading" => Self::Reading, 6118 "finished" => Self::Finished, 6119 "abandoned" => Self::Abandoned, 6120 "want-to-read" => Self::WantToRead, 6121 _ => Self::Other(jacquard_common::CowStr::from(s)), 6122 } 6123 } 6124} 6125 6126impl<'a> core::fmt::Display for ReadingProgressStatus<'a> { 6127 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 6128 write!(f, "{}", self.as_str()) 6129 } 6130} 6131 6132impl<'a> AsRef<str> for ReadingProgressStatus<'a> { 6133 fn as_ref(&self) -> &str { 6134 self.as_str() 6135 } 6136} 6137 6138impl<'a> serde::Serialize for ReadingProgressStatus<'a> { 6139 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 6140 where 6141 S: serde::Serializer, 6142 { 6143 serializer.serialize_str(self.as_str()) 6144 } 6145} 6146 6147impl<'de, 'a> serde::Deserialize<'de> for ReadingProgressStatus<'a> 6148where 6149 'de: 'a, 6150{ 6151 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 6152 where 6153 D: serde::Deserializer<'de>, 6154 { 6155 let s = <&'de str>::deserialize(deserializer)?; 6156 Ok(Self::from(s)) 6157 } 6158} 6159 6160impl<'a> Default for ReadingProgressStatus<'a> { 6161 fn default() -> Self { 6162 Self::Other(Default::default()) 6163 } 6164} 6165 6166impl jacquard_common::IntoStatic for ReadingProgressStatus<'_> { 6167 type Output = ReadingProgressStatus<'static>; 6168 fn into_static(self) -> Self::Output { 6169 match self { 6170 ReadingProgressStatus::Reading => ReadingProgressStatus::Reading, 6171 ReadingProgressStatus::Finished => ReadingProgressStatus::Finished, 6172 ReadingProgressStatus::Abandoned => ReadingProgressStatus::Abandoned, 6173 ReadingProgressStatus::WantToRead => ReadingProgressStatus::WantToRead, 6174 ReadingProgressStatus::Other(v) => { 6175 ReadingProgressStatus::Other(v.into_static()) 6176 } 6177 } 6178 } 6179} 6180 6181impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReadingProgress<'a> { 6182 fn nsid() -> &'static str { 6183 "sh.weaver.notebook.defs" 6184 } 6185 fn def_name() -> &'static str { 6186 "readingProgress" 6187 } 6188 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6189 lexicon_doc_sh_weaver_notebook_defs() 6190 } 6191 fn validate( 6192 &self, 6193 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6194 if let Some(ref value) = self.percent_complete { 6195 if *value > 100i64 { 6196 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { 6197 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 6198 "percent_complete", 6199 ), 6200 max: 100i64, 6201 actual: *value, 6202 }); 6203 } 6204 } 6205 if let Some(ref value) = self.percent_complete { 6206 if *value < 0i64 { 6207 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 6208 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 6209 "percent_complete", 6210 ), 6211 min: 0i64, 6212 actual: *value, 6213 }); 6214 } 6215 } 6216 Ok(()) 6217 } 6218} 6219 6220#[jacquard_derive::lexicon] 6221#[derive( 6222 serde::Serialize, 6223 serde::Deserialize, 6224 Debug, 6225 Clone, 6226 PartialEq, 6227 Eq, 6228 jacquard_derive::IntoStatic 6229)] 6230#[serde(rename_all = "camelCase")] 6231pub struct ReasonBookmark<'a> { 6232 #[serde(borrow)] 6233 pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, 6234 pub indexed_at: jacquard_common::types::string::Datetime, 6235} 6236 6237pub mod reason_bookmark_state { 6238 6239 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 6240 #[allow(unused)] 6241 use ::core::marker::PhantomData; 6242 mod sealed { 6243 pub trait Sealed {} 6244 } 6245 /// State trait tracking which required fields have been set 6246 pub trait State: sealed::Sealed { 6247 type By; 6248 type IndexedAt; 6249 } 6250 /// Empty state - all required fields are unset 6251 pub struct Empty(()); 6252 impl sealed::Sealed for Empty {} 6253 impl State for Empty { 6254 type By = Unset; 6255 type IndexedAt = Unset; 6256 } 6257 ///State transition - sets the `by` field to Set 6258 pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6259 impl<S: State> sealed::Sealed for SetBy<S> {} 6260 impl<S: State> State for SetBy<S> { 6261 type By = Set<members::by>; 6262 type IndexedAt = S::IndexedAt; 6263 } 6264 ///State transition - sets the `indexed_at` field to Set 6265 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6266 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6267 impl<S: State> State for SetIndexedAt<S> { 6268 type By = S::By; 6269 type IndexedAt = Set<members::indexed_at>; 6270 } 6271 /// Marker types for field names 6272 #[allow(non_camel_case_types)] 6273 pub mod members { 6274 ///Marker type for the `by` field 6275 pub struct by(()); 6276 ///Marker type for the `indexed_at` field 6277 pub struct indexed_at(()); 6278 } 6279} 6280 6281/// Builder for constructing an instance of this type 6282pub struct ReasonBookmarkBuilder<'a, S: reason_bookmark_state::State> { 6283 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 6284 __unsafe_private_named: ( 6285 ::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 6286 ::core::option::Option<jacquard_common::types::string::Datetime>, 6287 ), 6288 _phantom: ::core::marker::PhantomData<&'a ()>, 6289} 6290 6291impl<'a> ReasonBookmark<'a> { 6292 /// Create a new builder for this type 6293 pub fn new() -> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { 6294 ReasonBookmarkBuilder::new() 6295 } 6296} 6297 6298impl<'a> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { 6299 /// Create a new builder with all fields unset 6300 pub fn new() -> Self { 6301 ReasonBookmarkBuilder { 6302 _phantom_state: ::core::marker::PhantomData, 6303 __unsafe_private_named: (None, None), 6304 _phantom: ::core::marker::PhantomData, 6305 } 6306 } 6307} 6308 6309impl<'a, S> ReasonBookmarkBuilder<'a, S> 6310where 6311 S: reason_bookmark_state::State, 6312 S::By: reason_bookmark_state::IsUnset, 6313{ 6314 /// Set the `by` field (required) 6315 pub fn by( 6316 mut self, 6317 value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 6318 ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetBy<S>> { 6319 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 6320 ReasonBookmarkBuilder { 6321 _phantom_state: ::core::marker::PhantomData, 6322 __unsafe_private_named: self.__unsafe_private_named, 6323 _phantom: ::core::marker::PhantomData, 6324 } 6325 } 6326} 6327 6328impl<'a, S> ReasonBookmarkBuilder<'a, S> 6329where 6330 S: reason_bookmark_state::State, 6331 S::IndexedAt: reason_bookmark_state::IsUnset, 6332{ 6333 /// Set the `indexedAt` field (required) 6334 pub fn indexed_at( 6335 mut self, 6336 value: impl Into<jacquard_common::types::string::Datetime>, 6337 ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetIndexedAt<S>> { 6338 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 6339 ReasonBookmarkBuilder { 6340 _phantom_state: ::core::marker::PhantomData, 6341 __unsafe_private_named: self.__unsafe_private_named, 6342 _phantom: ::core::marker::PhantomData, 6343 } 6344 } 6345} 6346 6347impl<'a, S> ReasonBookmarkBuilder<'a, S> 6348where 6349 S: reason_bookmark_state::State, 6350 S::By: reason_bookmark_state::IsSet, 6351 S::IndexedAt: reason_bookmark_state::IsSet, 6352{ 6353 /// Build the final struct 6354 pub fn build(self) -> ReasonBookmark<'a> { 6355 ReasonBookmark { 6356 by: self.__unsafe_private_named.0.unwrap(), 6357 indexed_at: self.__unsafe_private_named.1.unwrap(), 6358 extra_data: Default::default(), 6359 } 6360 } 6361 /// Build the final struct with custom extra_data 6362 pub fn build_with_data( 6363 self, 6364 extra_data: std::collections::BTreeMap< 6365 jacquard_common::smol_str::SmolStr, 6366 jacquard_common::types::value::Data<'a>, 6367 >, 6368 ) -> ReasonBookmark<'a> { 6369 ReasonBookmark { 6370 by: self.__unsafe_private_named.0.unwrap(), 6371 indexed_at: self.__unsafe_private_named.1.unwrap(), 6372 extra_data: Some(extra_data), 6373 } 6374 } 6375} 6376 6377impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonBookmark<'a> { 6378 fn nsid() -> &'static str { 6379 "sh.weaver.notebook.defs" 6380 } 6381 fn def_name() -> &'static str { 6382 "reasonBookmark" 6383 } 6384 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6385 lexicon_doc_sh_weaver_notebook_defs() 6386 } 6387 fn validate( 6388 &self, 6389 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6390 Ok(()) 6391 } 6392} 6393 6394#[jacquard_derive::lexicon] 6395#[derive( 6396 serde::Serialize, 6397 serde::Deserialize, 6398 Debug, 6399 Clone, 6400 PartialEq, 6401 Eq, 6402 jacquard_derive::IntoStatic 6403)] 6404#[serde(rename_all = "camelCase")] 6405pub struct ReasonLike<'a> { 6406 #[serde(borrow)] 6407 pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, 6408 pub indexed_at: jacquard_common::types::string::Datetime, 6409} 6410 6411pub mod reason_like_state { 6412 6413 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 6414 #[allow(unused)] 6415 use ::core::marker::PhantomData; 6416 mod sealed { 6417 pub trait Sealed {} 6418 } 6419 /// State trait tracking which required fields have been set 6420 pub trait State: sealed::Sealed { 6421 type By; 6422 type IndexedAt; 6423 } 6424 /// Empty state - all required fields are unset 6425 pub struct Empty(()); 6426 impl sealed::Sealed for Empty {} 6427 impl State for Empty { 6428 type By = Unset; 6429 type IndexedAt = Unset; 6430 } 6431 ///State transition - sets the `by` field to Set 6432 pub struct SetBy<S: State = Empty>(PhantomData<fn() -> S>); 6433 impl<S: State> sealed::Sealed for SetBy<S> {} 6434 impl<S: State> State for SetBy<S> { 6435 type By = Set<members::by>; 6436 type IndexedAt = S::IndexedAt; 6437 } 6438 ///State transition - sets the `indexed_at` field to Set 6439 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6440 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6441 impl<S: State> State for SetIndexedAt<S> { 6442 type By = S::By; 6443 type IndexedAt = Set<members::indexed_at>; 6444 } 6445 /// Marker types for field names 6446 #[allow(non_camel_case_types)] 6447 pub mod members { 6448 ///Marker type for the `by` field 6449 pub struct by(()); 6450 ///Marker type for the `indexed_at` field 6451 pub struct indexed_at(()); 6452 } 6453} 6454 6455/// Builder for constructing an instance of this type 6456pub struct ReasonLikeBuilder<'a, S: reason_like_state::State> { 6457 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 6458 __unsafe_private_named: ( 6459 ::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 6460 ::core::option::Option<jacquard_common::types::string::Datetime>, 6461 ), 6462 _phantom: ::core::marker::PhantomData<&'a ()>, 6463} 6464 6465impl<'a> ReasonLike<'a> { 6466 /// Create a new builder for this type 6467 pub fn new() -> ReasonLikeBuilder<'a, reason_like_state::Empty> { 6468 ReasonLikeBuilder::new() 6469 } 6470} 6471 6472impl<'a> ReasonLikeBuilder<'a, reason_like_state::Empty> { 6473 /// Create a new builder with all fields unset 6474 pub fn new() -> Self { 6475 ReasonLikeBuilder { 6476 _phantom_state: ::core::marker::PhantomData, 6477 __unsafe_private_named: (None, None), 6478 _phantom: ::core::marker::PhantomData, 6479 } 6480 } 6481} 6482 6483impl<'a, S> ReasonLikeBuilder<'a, S> 6484where 6485 S: reason_like_state::State, 6486 S::By: reason_like_state::IsUnset, 6487{ 6488 /// Set the `by` field (required) 6489 pub fn by( 6490 mut self, 6491 value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>, 6492 ) -> ReasonLikeBuilder<'a, reason_like_state::SetBy<S>> { 6493 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 6494 ReasonLikeBuilder { 6495 _phantom_state: ::core::marker::PhantomData, 6496 __unsafe_private_named: self.__unsafe_private_named, 6497 _phantom: ::core::marker::PhantomData, 6498 } 6499 } 6500} 6501 6502impl<'a, S> ReasonLikeBuilder<'a, S> 6503where 6504 S: reason_like_state::State, 6505 S::IndexedAt: reason_like_state::IsUnset, 6506{ 6507 /// Set the `indexedAt` field (required) 6508 pub fn indexed_at( 6509 mut self, 6510 value: impl Into<jacquard_common::types::string::Datetime>, 6511 ) -> ReasonLikeBuilder<'a, reason_like_state::SetIndexedAt<S>> { 6512 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 6513 ReasonLikeBuilder { 6514 _phantom_state: ::core::marker::PhantomData, 6515 __unsafe_private_named: self.__unsafe_private_named, 6516 _phantom: ::core::marker::PhantomData, 6517 } 6518 } 6519} 6520 6521impl<'a, S> ReasonLikeBuilder<'a, S> 6522where 6523 S: reason_like_state::State, 6524 S::By: reason_like_state::IsSet, 6525 S::IndexedAt: reason_like_state::IsSet, 6526{ 6527 /// Build the final struct 6528 pub fn build(self) -> ReasonLike<'a> { 6529 ReasonLike { 6530 by: self.__unsafe_private_named.0.unwrap(), 6531 indexed_at: self.__unsafe_private_named.1.unwrap(), 6532 extra_data: Default::default(), 6533 } 6534 } 6535 /// Build the final struct with custom extra_data 6536 pub fn build_with_data( 6537 self, 6538 extra_data: std::collections::BTreeMap< 6539 jacquard_common::smol_str::SmolStr, 6540 jacquard_common::types::value::Data<'a>, 6541 >, 6542 ) -> ReasonLike<'a> { 6543 ReasonLike { 6544 by: self.__unsafe_private_named.0.unwrap(), 6545 indexed_at: self.__unsafe_private_named.1.unwrap(), 6546 extra_data: Some(extra_data), 6547 } 6548 } 6549} 6550 6551impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonLike<'a> { 6552 fn nsid() -> &'static str { 6553 "sh.weaver.notebook.defs" 6554 } 6555 fn def_name() -> &'static str { 6556 "reasonLike" 6557 } 6558 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6559 lexicon_doc_sh_weaver_notebook_defs() 6560 } 6561 fn validate( 6562 &self, 6563 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6564 Ok(()) 6565 } 6566} 6567 6568#[jacquard_derive::lexicon] 6569#[derive( 6570 serde::Serialize, 6571 serde::Deserialize, 6572 Debug, 6573 Clone, 6574 PartialEq, 6575 Eq, 6576 jacquard_derive::IntoStatic 6577)] 6578#[serde(rename_all = "camelCase")] 6579pub struct ReasonSubscription<'a> { 6580 pub indexed_at: jacquard_common::types::string::Datetime, 6581} 6582 6583pub mod reason_subscription_state { 6584 6585 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 6586 #[allow(unused)] 6587 use ::core::marker::PhantomData; 6588 mod sealed { 6589 pub trait Sealed {} 6590 } 6591 /// State trait tracking which required fields have been set 6592 pub trait State: sealed::Sealed { 6593 type IndexedAt; 6594 } 6595 /// Empty state - all required fields are unset 6596 pub struct Empty(()); 6597 impl sealed::Sealed for Empty {} 6598 impl State for Empty { 6599 type IndexedAt = Unset; 6600 } 6601 ///State transition - sets the `indexed_at` field to Set 6602 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>); 6603 impl<S: State> sealed::Sealed for SetIndexedAt<S> {} 6604 impl<S: State> State for SetIndexedAt<S> { 6605 type IndexedAt = Set<members::indexed_at>; 6606 } 6607 /// Marker types for field names 6608 #[allow(non_camel_case_types)] 6609 pub mod members { 6610 ///Marker type for the `indexed_at` field 6611 pub struct indexed_at(()); 6612 } 6613} 6614 6615/// Builder for constructing an instance of this type 6616pub struct ReasonSubscriptionBuilder<'a, S: reason_subscription_state::State> { 6617 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 6618 __unsafe_private_named: ( 6619 ::core::option::Option<jacquard_common::types::string::Datetime>, 6620 ), 6621 _phantom: ::core::marker::PhantomData<&'a ()>, 6622} 6623 6624impl<'a> ReasonSubscription<'a> { 6625 /// Create a new builder for this type 6626 pub fn new() -> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { 6627 ReasonSubscriptionBuilder::new() 6628 } 6629} 6630 6631impl<'a> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { 6632 /// Create a new builder with all fields unset 6633 pub fn new() -> Self { 6634 ReasonSubscriptionBuilder { 6635 _phantom_state: ::core::marker::PhantomData, 6636 __unsafe_private_named: (None,), 6637 _phantom: ::core::marker::PhantomData, 6638 } 6639 } 6640} 6641 6642impl<'a, S> ReasonSubscriptionBuilder<'a, S> 6643where 6644 S: reason_subscription_state::State, 6645 S::IndexedAt: reason_subscription_state::IsUnset, 6646{ 6647 /// Set the `indexedAt` field (required) 6648 pub fn indexed_at( 6649 mut self, 6650 value: impl Into<jacquard_common::types::string::Datetime>, 6651 ) -> ReasonSubscriptionBuilder<'a, reason_subscription_state::SetIndexedAt<S>> { 6652 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 6653 ReasonSubscriptionBuilder { 6654 _phantom_state: ::core::marker::PhantomData, 6655 __unsafe_private_named: self.__unsafe_private_named, 6656 _phantom: ::core::marker::PhantomData, 6657 } 6658 } 6659} 6660 6661impl<'a, S> ReasonSubscriptionBuilder<'a, S> 6662where 6663 S: reason_subscription_state::State, 6664 S::IndexedAt: reason_subscription_state::IsSet, 6665{ 6666 /// Build the final struct 6667 pub fn build(self) -> ReasonSubscription<'a> { 6668 ReasonSubscription { 6669 indexed_at: self.__unsafe_private_named.0.unwrap(), 6670 extra_data: Default::default(), 6671 } 6672 } 6673 /// Build the final struct with custom extra_data 6674 pub fn build_with_data( 6675 self, 6676 extra_data: std::collections::BTreeMap< 6677 jacquard_common::smol_str::SmolStr, 6678 jacquard_common::types::value::Data<'a>, 6679 >, 6680 ) -> ReasonSubscription<'a> { 6681 ReasonSubscription { 6682 indexed_at: self.__unsafe_private_named.0.unwrap(), 6683 extra_data: Some(extra_data), 6684 } 6685 } 6686} 6687 6688impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonSubscription<'a> { 6689 fn nsid() -> &'static str { 6690 "sh.weaver.notebook.defs" 6691 } 6692 fn def_name() -> &'static str { 6693 "reasonSubscription" 6694 } 6695 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6696 lexicon_doc_sh_weaver_notebook_defs() 6697 } 6698 fn validate( 6699 &self, 6700 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6701 Ok(()) 6702 } 6703} 6704 6705/// View of a rendered and cached notebook entry 6706#[jacquard_derive::lexicon] 6707#[derive( 6708 serde::Serialize, 6709 serde::Deserialize, 6710 Debug, 6711 Clone, 6712 PartialEq, 6713 Eq, 6714 jacquard_derive::IntoStatic 6715)] 6716#[serde(rename_all = "camelCase")] 6717pub struct RenderedView<'a> { 6718 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6719 #[serde(borrow)] 6720 pub css: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 6721 #[serde(borrow)] 6722 pub html: jacquard_common::types::blob::BlobRef<'a>, 6723} 6724 6725pub mod rendered_view_state { 6726 6727 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 6728 #[allow(unused)] 6729 use ::core::marker::PhantomData; 6730 mod sealed { 6731 pub trait Sealed {} 6732 } 6733 /// State trait tracking which required fields have been set 6734 pub trait State: sealed::Sealed { 6735 type Html; 6736 } 6737 /// Empty state - all required fields are unset 6738 pub struct Empty(()); 6739 impl sealed::Sealed for Empty {} 6740 impl State for Empty { 6741 type Html = Unset; 6742 } 6743 ///State transition - sets the `html` field to Set 6744 pub struct SetHtml<S: State = Empty>(PhantomData<fn() -> S>); 6745 impl<S: State> sealed::Sealed for SetHtml<S> {} 6746 impl<S: State> State for SetHtml<S> { 6747 type Html = Set<members::html>; 6748 } 6749 /// Marker types for field names 6750 #[allow(non_camel_case_types)] 6751 pub mod members { 6752 ///Marker type for the `html` field 6753 pub struct html(()); 6754 } 6755} 6756 6757/// Builder for constructing an instance of this type 6758pub struct RenderedViewBuilder<'a, S: rendered_view_state::State> { 6759 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 6760 __unsafe_private_named: ( 6761 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 6762 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 6763 ), 6764 _phantom: ::core::marker::PhantomData<&'a ()>, 6765} 6766 6767impl<'a> RenderedView<'a> { 6768 /// Create a new builder for this type 6769 pub fn new() -> RenderedViewBuilder<'a, rendered_view_state::Empty> { 6770 RenderedViewBuilder::new() 6771 } 6772} 6773 6774impl<'a> RenderedViewBuilder<'a, rendered_view_state::Empty> { 6775 /// Create a new builder with all fields unset 6776 pub fn new() -> Self { 6777 RenderedViewBuilder { 6778 _phantom_state: ::core::marker::PhantomData, 6779 __unsafe_private_named: (None, None), 6780 _phantom: ::core::marker::PhantomData, 6781 } 6782 } 6783} 6784 6785impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> { 6786 /// Set the `css` field (optional) 6787 pub fn css( 6788 mut self, 6789 value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 6790 ) -> Self { 6791 self.__unsafe_private_named.0 = value.into(); 6792 self 6793 } 6794 /// Set the `css` field to an Option value (optional) 6795 pub fn maybe_css( 6796 mut self, 6797 value: Option<jacquard_common::types::blob::BlobRef<'a>>, 6798 ) -> Self { 6799 self.__unsafe_private_named.0 = value; 6800 self 6801 } 6802} 6803 6804impl<'a, S> RenderedViewBuilder<'a, S> 6805where 6806 S: rendered_view_state::State, 6807 S::Html: rendered_view_state::IsUnset, 6808{ 6809 /// Set the `html` field (required) 6810 pub fn html( 6811 mut self, 6812 value: impl Into<jacquard_common::types::blob::BlobRef<'a>>, 6813 ) -> RenderedViewBuilder<'a, rendered_view_state::SetHtml<S>> { 6814 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 6815 RenderedViewBuilder { 6816 _phantom_state: ::core::marker::PhantomData, 6817 __unsafe_private_named: self.__unsafe_private_named, 6818 _phantom: ::core::marker::PhantomData, 6819 } 6820 } 6821} 6822 6823impl<'a, S> RenderedViewBuilder<'a, S> 6824where 6825 S: rendered_view_state::State, 6826 S::Html: rendered_view_state::IsSet, 6827{ 6828 /// Build the final struct 6829 pub fn build(self) -> RenderedView<'a> { 6830 RenderedView { 6831 css: self.__unsafe_private_named.0, 6832 html: self.__unsafe_private_named.1.unwrap(), 6833 extra_data: Default::default(), 6834 } 6835 } 6836 /// Build the final struct with custom extra_data 6837 pub fn build_with_data( 6838 self, 6839 extra_data: std::collections::BTreeMap< 6840 jacquard_common::smol_str::SmolStr, 6841 jacquard_common::types::value::Data<'a>, 6842 >, 6843 ) -> RenderedView<'a> { 6844 RenderedView { 6845 css: self.__unsafe_private_named.0, 6846 html: self.__unsafe_private_named.1.unwrap(), 6847 extra_data: Some(extra_data), 6848 } 6849 } 6850} 6851 6852impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> { 6853 fn nsid() -> &'static str { 6854 "sh.weaver.notebook.defs" 6855 } 6856 fn def_name() -> &'static str { 6857 "renderedView" 6858 } 6859 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 6860 lexicon_doc_sh_weaver_notebook_defs() 6861 } 6862 fn validate( 6863 &self, 6864 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6865 Ok(()) 6866 } 6867} 6868 6869/// An array of tags associated with the notebook entry. Tags can help categorize and organize entries. 6870pub type Tags<'a> = Vec<jacquard_common::CowStr<'a>>; 6871/// The title of the notebook entry. 6872pub type Title<'a> = jacquard_common::CowStr<'a>;