1pub mod authors;
9pub mod book;
10pub mod chapter;
11pub mod entry;
12
13#[jacquard_derive::lexicon]
14#[derive(
15 serde::Serialize,
16 serde::Deserialize,
17 Debug,
18 Clone,
19 PartialEq,
20 Eq,
21 jacquard_derive::IntoStatic
22)]
23#[serde(rename_all = "camelCase")]
24pub struct AuthorListView<'a> {
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 #[serde(borrow)]
27 pub cid: Option<jacquard_common::types::string::Cid<'a>>,
28 pub index: i64,
29 #[serde(skip_serializing_if = "std::option::Option::is_none")]
30 #[serde(borrow)]
31 pub record: Option<jacquard_common::types::value::Data<'a>>,
32 #[serde(skip_serializing_if = "std::option::Option::is_none")]
33 #[serde(borrow)]
34 pub uri: Option<jacquard_common::types::string::AtUri<'a>>,
35}
36
37pub mod author_list_view_state {
38
39 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
40 #[allow(unused)]
41 use ::core::marker::PhantomData;
42 mod sealed {
43 pub trait Sealed {}
44 }
45 pub trait State: sealed::Sealed {
47 type Profile;
48 type Index;
49 }
50 pub struct Empty(());
52 impl sealed::Sealed for Empty {}
53 impl State for Empty {
54 type Profile = Unset;
55 type Index = Unset;
56 }
57 pub struct SetProfile<S: State = Empty>(PhantomData<fn() -> S>);
59 impl<S: State> sealed::Sealed for SetProfile<S> {}
60 impl<S: State> State for SetProfile<S> {
61 type Profile = Set<members::profile>;
62 type Index = S::Index;
63 }
64 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>);
66 impl<S: State> sealed::Sealed for SetIndex<S> {}
67 impl<S: State> State for SetIndex<S> {
68 type Profile = S::Profile;
69 type Index = Set<members::index>;
70 }
71 #[allow(non_camel_case_types)]
73 pub mod members {
74 pub struct profile(());
76 pub struct index(());
78 }
79}
80
81pub struct AuthorListViewBuilder<'a, S: author_list_view_state::State> {
83 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
84 __unsafe_private_named: (
85 ::core::option::Option<jacquard_common::types::string::Cid<'a>>,
86 ::core::option::Option<i64>,
87 ::core::option::Option<jacquard_common::types::value::Data<'a>>,
88 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
89 ),
90 _phantom: ::core::marker::PhantomData<&'a ()>,
91}
92
93impl<'a> AuthorListView<'a> {
94 pub fn new() -> AuthorListViewBuilder<'a, author_list_view_state::Empty> {
96 AuthorListViewBuilder::new()
97 }
98}
99
100impl<'a> AuthorListViewBuilder<'a, author_list_view_state::Empty> {
101 pub fn new() -> Self {
103 AuthorListViewBuilder {
104 _phantom_state: ::core::marker::PhantomData,
105 __unsafe_private_named: (None, None, None, None),
106 _phantom: ::core::marker::PhantomData,
107 }
108 }
109}
110
111impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> {
112 pub fn cid(
114 mut self,
115 value: impl Into<Option<jacquard_common::types::string::Cid<'a>>>,
116 ) -> Self {
117 self.__unsafe_private_named.0 = value.into();
118 self
119 }
120 pub fn maybe_cid(
122 mut self,
123 value: Option<jacquard_common::types::string::Cid<'a>>,
124 ) -> Self {
125 self.__unsafe_private_named.0 = value;
126 self
127 }
128}
129
130impl<'a, S> AuthorListViewBuilder<'a, S>
131where
132 S: author_list_view_state::State,
133 S::Index: author_list_view_state::IsUnset,
134{
135 pub fn index(
137 mut self,
138 value: impl Into<i64>,
139 ) -> AuthorListViewBuilder<'a, author_list_view_state::SetIndex<S>> {
140 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
141 AuthorListViewBuilder {
142 _phantom_state: ::core::marker::PhantomData,
143 __unsafe_private_named: self.__unsafe_private_named,
144 _phantom: ::core::marker::PhantomData,
145 }
146 }
147}
148
149impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> {
150 pub fn record(
152 mut self,
153 value: impl Into<Option<jacquard_common::types::value::Data<'a>>>,
154 ) -> Self {
155 self.__unsafe_private_named.2 = value.into();
156 self
157 }
158 pub fn maybe_record(
160 mut self,
161 value: Option<jacquard_common::types::value::Data<'a>>,
162 ) -> Self {
163 self.__unsafe_private_named.2 = value;
164 self
165 }
166}
167
168impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> {
169 pub fn uri(
171 mut self,
172 value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
173 ) -> Self {
174 self.__unsafe_private_named.3 = value.into();
175 self
176 }
177 pub fn maybe_uri(
179 mut self,
180 value: Option<jacquard_common::types::string::AtUri<'a>>,
181 ) -> Self {
182 self.__unsafe_private_named.3 = value;
183 self
184 }
185}
186
187impl<'a, S> AuthorListViewBuilder<'a, S>
188where
189 S: author_list_view_state::State,
190 S::Profile: author_list_view_state::IsSet,
191 S::Index: author_list_view_state::IsSet,
192{
193 pub fn build(self) -> AuthorListView<'a> {
195 AuthorListView {
196 cid: self.__unsafe_private_named.0,
197 index: self.__unsafe_private_named.1.unwrap(),
198 record: self.__unsafe_private_named.2,
199 uri: self.__unsafe_private_named.3,
200 extra_data: Default::default(),
201 }
202 }
203 pub fn build_with_data(
205 self,
206 extra_data: std::collections::BTreeMap<
207 jacquard_common::smol_str::SmolStr,
208 jacquard_common::types::value::Data<'a>,
209 >,
210 ) -> AuthorListView<'a> {
211 AuthorListView {
212 cid: self.__unsafe_private_named.0,
213 index: self.__unsafe_private_named.1.unwrap(),
214 record: self.__unsafe_private_named.2,
215 uri: self.__unsafe_private_named.3,
216 extra_data: Some(extra_data),
217 }
218 }
219}
220
221fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
222 'static,
223> {
224 ::jacquard_lexicon::lexicon::LexiconDoc {
225 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
226 id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs"),
227 revision: None,
228 description: None,
229 defs: {
230 let mut map = ::std::collections::BTreeMap::new();
231 map.insert(
232 ::jacquard_common::smol_str::SmolStr::new_static("authorListView"),
233 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
234 description: None,
235 required: Some(
236 vec![
237 ::jacquard_common::smol_str::SmolStr::new_static("profile"),
238 ::jacquard_common::smol_str::SmolStr::new_static("index")
239 ],
240 ),
241 nullable: None,
242 properties: {
243 #[allow(unused_mut)]
244 let mut map = ::std::collections::BTreeMap::new();
245 map.insert(
246 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
247 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
248 description: None,
249 format: Some(
250 ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
251 ),
252 default: None,
253 min_length: None,
254 max_length: None,
255 min_graphemes: None,
256 max_graphemes: None,
257 r#enum: None,
258 r#const: None,
259 known_values: None,
260 }),
261 );
262 map.insert(
263 ::jacquard_common::smol_str::SmolStr::new_static("index"),
264 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
265 description: None,
266 default: None,
267 minimum: None,
268 maximum: None,
269 r#enum: None,
270 r#const: None,
271 }),
272 );
273 map.insert(
274 ::jacquard_common::smol_str::SmolStr::new_static("record"),
275 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
276 description: None,
277 }),
278 );
279 map.insert(
280 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
281 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
282 description: None,
283 format: Some(
284 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
285 ),
286 default: None,
287 min_length: None,
288 max_length: None,
289 min_graphemes: None,
290 max_graphemes: None,
291 r#enum: None,
292 r#const: None,
293 known_values: None,
294 }),
295 );
296 map
297 },
298 }),
299 );
300 map.insert(
301 ::jacquard_common::smol_str::SmolStr::new_static("bookEntryRef"),
302 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
303 description: None,
304 required: Some(
305 vec![::jacquard_common::smol_str::SmolStr::new_static("entry")],
306 ),
307 nullable: None,
308 properties: {
309 #[allow(unused_mut)]
310 let mut map = ::std::collections::BTreeMap::new();
311 map.insert(
312 ::jacquard_common::smol_str::SmolStr::new_static("entry"),
313 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
314 description: None,
315 r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
316 }),
317 );
318 map
319 },
320 }),
321 );
322 map.insert(
323 ::jacquard_common::smol_str::SmolStr::new_static("bookEntryView"),
324 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
325 description: Some(
326 ::jacquard_common::CowStr::new_static(
327 "An ordered entry in a Weaver notebook.",
328 ),
329 ),
330 required: Some(
331 vec![
332 ::jacquard_common::smol_str::SmolStr::new_static("entry"),
333 ::jacquard_common::smol_str::SmolStr::new_static("index")
334 ],
335 ),
336 nullable: None,
337 properties: {
338 #[allow(unused_mut)]
339 let mut map = ::std::collections::BTreeMap::new();
340 map.insert(
341 ::jacquard_common::smol_str::SmolStr::new_static("entry"),
342 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
343 description: None,
344 r#ref: ::jacquard_common::CowStr::new_static("#entryView"),
345 }),
346 );
347 map.insert(
348 ::jacquard_common::smol_str::SmolStr::new_static("index"),
349 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
350 description: None,
351 default: None,
352 minimum: None,
353 maximum: None,
354 r#enum: None,
355 r#const: None,
356 }),
357 );
358 map.insert(
359 ::jacquard_common::smol_str::SmolStr::new_static("next"),
360 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
361 description: None,
362 r#ref: ::jacquard_common::CowStr::new_static(
363 "#bookEntryRef",
364 ),
365 }),
366 );
367 map.insert(
368 ::jacquard_common::smol_str::SmolStr::new_static("prev"),
369 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
370 description: None,
371 r#ref: ::jacquard_common::CowStr::new_static(
372 "#bookEntryRef",
373 ),
374 }),
375 );
376 map
377 },
378 }),
379 );
380 map.insert(
381 ::jacquard_common::smol_str::SmolStr::new_static("contentFormat"),
382 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
383 description: Some(
384 ::jacquard_common::CowStr::new_static(
385 "The format of the content. This is used to determine how to render the content.",
386 ),
387 ),
388 required: None,
389 nullable: None,
390 properties: {
391 #[allow(unused_mut)]
392 let mut map = ::std::collections::BTreeMap::new();
393 map.insert(
394 ::jacquard_common::smol_str::SmolStr::new_static("markdown"),
395 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
396 description: Some(
397 ::jacquard_common::CowStr::new_static(
398 "The format of the content. This is used to determine how to render the content.",
399 ),
400 ),
401 format: None,
402 default: None,
403 min_length: None,
404 max_length: None,
405 min_graphemes: None,
406 max_graphemes: None,
407 r#enum: None,
408 r#const: None,
409 known_values: None,
410 }),
411 );
412 map
413 },
414 }),
415 );
416 map.insert(
417 ::jacquard_common::smol_str::SmolStr::new_static("entryView"),
418 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
419 description: None,
420 required: Some(
421 vec![
422 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
423 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
424 ::jacquard_common::smol_str::SmolStr::new_static("author"),
425 ::jacquard_common::smol_str::SmolStr::new_static("record"),
426 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt")
427 ],
428 ),
429 nullable: None,
430 properties: {
431 #[allow(unused_mut)]
432 let mut map = ::std::collections::BTreeMap::new();
433 map.insert(
434 ::jacquard_common::smol_str::SmolStr::new_static("authors"),
435 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
436 description: None,
437 r#ref: ::jacquard_common::CowStr::new_static(
438 "#authorListView",
439 ),
440 }),
441 );
442 map.insert(
443 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
444 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
445 description: None,
446 format: Some(
447 ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
448 ),
449 default: None,
450 min_length: None,
451 max_length: None,
452 min_graphemes: None,
453 max_graphemes: None,
454 r#enum: None,
455 r#const: None,
456 known_values: None,
457 }),
458 );
459 map.insert(
460 ::jacquard_common::smol_str::SmolStr::new_static(
461 "indexedAt",
462 ),
463 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
464 description: None,
465 format: Some(
466 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
467 ),
468 default: None,
469 min_length: None,
470 max_length: None,
471 min_graphemes: None,
472 max_graphemes: None,
473 r#enum: None,
474 r#const: None,
475 known_values: None,
476 }),
477 );
478 map.insert(
479 ::jacquard_common::smol_str::SmolStr::new_static("record"),
480 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
481 description: None,
482 }),
483 );
484 map.insert(
485 ::jacquard_common::smol_str::SmolStr::new_static(
486 "renderedView",
487 ),
488 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
489 description: None,
490 r#ref: ::jacquard_common::CowStr::new_static(
491 "#renderedView",
492 ),
493 }),
494 );
495 map.insert(
496 ::jacquard_common::smol_str::SmolStr::new_static("tags"),
497 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
498 description: None,
499 r#ref: ::jacquard_common::CowStr::new_static("#tags"),
500 }),
501 );
502 map.insert(
503 ::jacquard_common::smol_str::SmolStr::new_static("title"),
504 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
505 description: None,
506 r#ref: ::jacquard_common::CowStr::new_static("#title"),
507 }),
508 );
509 map.insert(
510 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
511 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
512 description: None,
513 format: Some(
514 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
515 ),
516 default: None,
517 min_length: None,
518 max_length: None,
519 min_graphemes: None,
520 max_graphemes: None,
521 r#enum: None,
522 r#const: None,
523 known_values: None,
524 }),
525 );
526 map
527 },
528 }),
529 );
530 map.insert(
531 ::jacquard_common::smol_str::SmolStr::new_static("notebookView"),
532 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
533 description: None,
534 required: Some(
535 vec![
536 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
537 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
538 ::jacquard_common::smol_str::SmolStr::new_static("author"),
539 ::jacquard_common::smol_str::SmolStr::new_static("record"),
540 ::jacquard_common::smol_str::SmolStr::new_static("indexedAt")
541 ],
542 ),
543 nullable: None,
544 properties: {
545 #[allow(unused_mut)]
546 let mut map = ::std::collections::BTreeMap::new();
547 map.insert(
548 ::jacquard_common::smol_str::SmolStr::new_static("authors"),
549 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
550 description: None,
551 r#ref: ::jacquard_common::CowStr::new_static(
552 "#authorListView",
553 ),
554 }),
555 );
556 map.insert(
557 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
558 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
559 description: None,
560 format: Some(
561 ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
562 ),
563 default: None,
564 min_length: None,
565 max_length: None,
566 min_graphemes: None,
567 max_graphemes: None,
568 r#enum: None,
569 r#const: None,
570 known_values: None,
571 }),
572 );
573 map.insert(
574 ::jacquard_common::smol_str::SmolStr::new_static(
575 "indexedAt",
576 ),
577 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
578 description: None,
579 format: Some(
580 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
581 ),
582 default: None,
583 min_length: None,
584 max_length: None,
585 min_graphemes: None,
586 max_graphemes: None,
587 r#enum: None,
588 r#const: None,
589 known_values: None,
590 }),
591 );
592 map.insert(
593 ::jacquard_common::smol_str::SmolStr::new_static("record"),
594 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
595 description: None,
596 }),
597 );
598 map.insert(
599 ::jacquard_common::smol_str::SmolStr::new_static("tags"),
600 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
601 description: None,
602 r#ref: ::jacquard_common::CowStr::new_static("#tags"),
603 }),
604 );
605 map.insert(
606 ::jacquard_common::smol_str::SmolStr::new_static("title"),
607 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
608 description: None,
609 r#ref: ::jacquard_common::CowStr::new_static("#title"),
610 }),
611 );
612 map.insert(
613 ::jacquard_common::smol_str::SmolStr::new_static("uri"),
614 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
615 description: None,
616 format: Some(
617 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
618 ),
619 default: None,
620 min_length: None,
621 max_length: None,
622 min_graphemes: None,
623 max_graphemes: None,
624 r#enum: None,
625 r#const: None,
626 known_values: None,
627 }),
628 );
629 map
630 },
631 }),
632 );
633 map.insert(
634 ::jacquard_common::smol_str::SmolStr::new_static("renderedView"),
635 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
636 description: Some(
637 ::jacquard_common::CowStr::new_static(
638 "View of a rendered and cached notebook entry",
639 ),
640 ),
641 required: Some(
642 vec![::jacquard_common::smol_str::SmolStr::new_static("html")],
643 ),
644 nullable: None,
645 properties: {
646 #[allow(unused_mut)]
647 let mut map = ::std::collections::BTreeMap::new();
648 map.insert(
649 ::jacquard_common::smol_str::SmolStr::new_static("css"),
650 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
651 description: None,
652 accept: None,
653 max_size: None,
654 }),
655 );
656 map.insert(
657 ::jacquard_common::smol_str::SmolStr::new_static("html"),
658 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
659 description: None,
660 accept: None,
661 max_size: None,
662 }),
663 );
664 map
665 },
666 }),
667 );
668 map.insert(
669 ::jacquard_common::smol_str::SmolStr::new_static("tags"),
670 ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray {
671 description: None,
672 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
673 description: None,
674 format: None,
675 default: None,
676 min_length: None,
677 max_length: Some(64usize),
678 min_graphemes: None,
679 max_graphemes: None,
680 r#enum: None,
681 r#const: None,
682 known_values: None,
683 }),
684 min_length: None,
685 max_length: Some(10usize),
686 }),
687 );
688 map.insert(
689 ::jacquard_common::smol_str::SmolStr::new_static("title"),
690 ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
691 description: Some(
692 ::jacquard_common::CowStr::new_static(
693 "The title of the notebook entry.",
694 ),
695 ),
696 format: None,
697 default: None,
698 min_length: None,
699 max_length: Some(300usize),
700 min_graphemes: None,
701 max_graphemes: None,
702 r#enum: None,
703 r#const: None,
704 known_values: None,
705 }),
706 );
707 map
708 },
709 }
710}
711
712impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> {
713 fn nsid() -> &'static str {
714 "sh.weaver.notebook.defs"
715 }
716 fn def_name() -> &'static str {
717 "authorListView"
718 }
719 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
720 lexicon_doc_sh_weaver_notebook_defs()
721 }
722 fn validate(
723 &self,
724 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
725 Ok(())
726 }
727}
728
729#[jacquard_derive::lexicon]
730#[derive(
731 serde::Serialize,
732 serde::Deserialize,
733 Debug,
734 Clone,
735 PartialEq,
736 Eq,
737 jacquard_derive::IntoStatic
738)]
739#[serde(rename_all = "camelCase")]
740pub struct BookEntryRef<'a> {
741 #[serde(borrow)]
742 pub entry: crate::sh_weaver::notebook::EntryView<'a>,
743}
744
745pub mod book_entry_ref_state {
746
747 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
748 #[allow(unused)]
749 use ::core::marker::PhantomData;
750 mod sealed {
751 pub trait Sealed {}
752 }
753 pub trait State: sealed::Sealed {
755 type Entry;
756 }
757 pub struct Empty(());
759 impl sealed::Sealed for Empty {}
760 impl State for Empty {
761 type Entry = Unset;
762 }
763 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
765 impl<S: State> sealed::Sealed for SetEntry<S> {}
766 impl<S: State> State for SetEntry<S> {
767 type Entry = Set<members::entry>;
768 }
769 #[allow(non_camel_case_types)]
771 pub mod members {
772 pub struct entry(());
774 }
775}
776
777pub struct BookEntryRefBuilder<'a, S: book_entry_ref_state::State> {
779 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
780 __unsafe_private_named: (
781 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
782 ),
783 _phantom: ::core::marker::PhantomData<&'a ()>,
784}
785
786impl<'a> BookEntryRef<'a> {
787 pub fn new() -> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> {
789 BookEntryRefBuilder::new()
790 }
791}
792
793impl<'a> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> {
794 pub fn new() -> Self {
796 BookEntryRefBuilder {
797 _phantom_state: ::core::marker::PhantomData,
798 __unsafe_private_named: (None,),
799 _phantom: ::core::marker::PhantomData,
800 }
801 }
802}
803
804impl<'a, S> BookEntryRefBuilder<'a, S>
805where
806 S: book_entry_ref_state::State,
807 S::Entry: book_entry_ref_state::IsUnset,
808{
809 pub fn entry(
811 mut self,
812 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
813 ) -> BookEntryRefBuilder<'a, book_entry_ref_state::SetEntry<S>> {
814 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
815 BookEntryRefBuilder {
816 _phantom_state: ::core::marker::PhantomData,
817 __unsafe_private_named: self.__unsafe_private_named,
818 _phantom: ::core::marker::PhantomData,
819 }
820 }
821}
822
823impl<'a, S> BookEntryRefBuilder<'a, S>
824where
825 S: book_entry_ref_state::State,
826 S::Entry: book_entry_ref_state::IsSet,
827{
828 pub fn build(self) -> BookEntryRef<'a> {
830 BookEntryRef {
831 entry: self.__unsafe_private_named.0.unwrap(),
832 extra_data: Default::default(),
833 }
834 }
835 pub fn build_with_data(
837 self,
838 extra_data: std::collections::BTreeMap<
839 jacquard_common::smol_str::SmolStr,
840 jacquard_common::types::value::Data<'a>,
841 >,
842 ) -> BookEntryRef<'a> {
843 BookEntryRef {
844 entry: self.__unsafe_private_named.0.unwrap(),
845 extra_data: Some(extra_data),
846 }
847 }
848}
849
850impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> {
851 fn nsid() -> &'static str {
852 "sh.weaver.notebook.defs"
853 }
854 fn def_name() -> &'static str {
855 "bookEntryRef"
856 }
857 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
858 lexicon_doc_sh_weaver_notebook_defs()
859 }
860 fn validate(
861 &self,
862 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
863 Ok(())
864 }
865}
866
867#[jacquard_derive::lexicon]
869#[derive(
870 serde::Serialize,
871 serde::Deserialize,
872 Debug,
873 Clone,
874 PartialEq,
875 Eq,
876 jacquard_derive::IntoStatic
877)]
878#[serde(rename_all = "camelCase")]
879pub struct BookEntryView<'a> {
880 #[serde(borrow)]
881 pub entry: crate::sh_weaver::notebook::EntryView<'a>,
882 pub index: i64,
883 #[serde(skip_serializing_if = "std::option::Option::is_none")]
884 #[serde(borrow)]
885 pub next: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
886 #[serde(skip_serializing_if = "std::option::Option::is_none")]
887 #[serde(borrow)]
888 pub prev: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
889}
890
891pub mod book_entry_view_state {
892
893 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
894 #[allow(unused)]
895 use ::core::marker::PhantomData;
896 mod sealed {
897 pub trait Sealed {}
898 }
899 pub trait State: sealed::Sealed {
901 type Entry;
902 type Index;
903 }
904 pub struct Empty(());
906 impl sealed::Sealed for Empty {}
907 impl State for Empty {
908 type Entry = Unset;
909 type Index = Unset;
910 }
911 pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
913 impl<S: State> sealed::Sealed for SetEntry<S> {}
914 impl<S: State> State for SetEntry<S> {
915 type Entry = Set<members::entry>;
916 type Index = S::Index;
917 }
918 pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>);
920 impl<S: State> sealed::Sealed for SetIndex<S> {}
921 impl<S: State> State for SetIndex<S> {
922 type Entry = S::Entry;
923 type Index = Set<members::index>;
924 }
925 #[allow(non_camel_case_types)]
927 pub mod members {
928 pub struct entry(());
930 pub struct index(());
932 }
933}
934
935pub struct BookEntryViewBuilder<'a, S: book_entry_view_state::State> {
937 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
938 __unsafe_private_named: (
939 ::core::option::Option<crate::sh_weaver::notebook::EntryView<'a>>,
940 ::core::option::Option<i64>,
941 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
942 ::core::option::Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
943 ),
944 _phantom: ::core::marker::PhantomData<&'a ()>,
945}
946
947impl<'a> BookEntryView<'a> {
948 pub fn new() -> BookEntryViewBuilder<'a, book_entry_view_state::Empty> {
950 BookEntryViewBuilder::new()
951 }
952}
953
954impl<'a> BookEntryViewBuilder<'a, book_entry_view_state::Empty> {
955 pub fn new() -> Self {
957 BookEntryViewBuilder {
958 _phantom_state: ::core::marker::PhantomData,
959 __unsafe_private_named: (None, None, None, None),
960 _phantom: ::core::marker::PhantomData,
961 }
962 }
963}
964
965impl<'a, S> BookEntryViewBuilder<'a, S>
966where
967 S: book_entry_view_state::State,
968 S::Entry: book_entry_view_state::IsUnset,
969{
970 pub fn entry(
972 mut self,
973 value: impl Into<crate::sh_weaver::notebook::EntryView<'a>>,
974 ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetEntry<S>> {
975 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
976 BookEntryViewBuilder {
977 _phantom_state: ::core::marker::PhantomData,
978 __unsafe_private_named: self.__unsafe_private_named,
979 _phantom: ::core::marker::PhantomData,
980 }
981 }
982}
983
984impl<'a, S> BookEntryViewBuilder<'a, S>
985where
986 S: book_entry_view_state::State,
987 S::Index: book_entry_view_state::IsUnset,
988{
989 pub fn index(
991 mut self,
992 value: impl Into<i64>,
993 ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetIndex<S>> {
994 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
995 BookEntryViewBuilder {
996 _phantom_state: ::core::marker::PhantomData,
997 __unsafe_private_named: self.__unsafe_private_named,
998 _phantom: ::core::marker::PhantomData,
999 }
1000 }
1001}
1002
1003impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> {
1004 pub fn next(
1006 mut self,
1007 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
1008 ) -> Self {
1009 self.__unsafe_private_named.2 = value.into();
1010 self
1011 }
1012 pub fn maybe_next(
1014 mut self,
1015 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
1016 ) -> Self {
1017 self.__unsafe_private_named.2 = value;
1018 self
1019 }
1020}
1021
1022impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> {
1023 pub fn prev(
1025 mut self,
1026 value: impl Into<Option<crate::sh_weaver::notebook::BookEntryRef<'a>>>,
1027 ) -> Self {
1028 self.__unsafe_private_named.3 = value.into();
1029 self
1030 }
1031 pub fn maybe_prev(
1033 mut self,
1034 value: Option<crate::sh_weaver::notebook::BookEntryRef<'a>>,
1035 ) -> Self {
1036 self.__unsafe_private_named.3 = value;
1037 self
1038 }
1039}
1040
1041impl<'a, S> BookEntryViewBuilder<'a, S>
1042where
1043 S: book_entry_view_state::State,
1044 S::Entry: book_entry_view_state::IsSet,
1045 S::Index: book_entry_view_state::IsSet,
1046{
1047 pub fn build(self) -> BookEntryView<'a> {
1049 BookEntryView {
1050 entry: self.__unsafe_private_named.0.unwrap(),
1051 index: self.__unsafe_private_named.1.unwrap(),
1052 next: self.__unsafe_private_named.2,
1053 prev: self.__unsafe_private_named.3,
1054 extra_data: Default::default(),
1055 }
1056 }
1057 pub fn build_with_data(
1059 self,
1060 extra_data: std::collections::BTreeMap<
1061 jacquard_common::smol_str::SmolStr,
1062 jacquard_common::types::value::Data<'a>,
1063 >,
1064 ) -> BookEntryView<'a> {
1065 BookEntryView {
1066 entry: self.__unsafe_private_named.0.unwrap(),
1067 index: self.__unsafe_private_named.1.unwrap(),
1068 next: self.__unsafe_private_named.2,
1069 prev: self.__unsafe_private_named.3,
1070 extra_data: Some(extra_data),
1071 }
1072 }
1073}
1074
1075impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryView<'a> {
1076 fn nsid() -> &'static str {
1077 "sh.weaver.notebook.defs"
1078 }
1079 fn def_name() -> &'static str {
1080 "bookEntryView"
1081 }
1082 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1083 lexicon_doc_sh_weaver_notebook_defs()
1084 }
1085 fn validate(
1086 &self,
1087 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1088 Ok(())
1089 }
1090}
1091
1092#[jacquard_derive::lexicon]
1094#[derive(
1095 serde::Serialize,
1096 serde::Deserialize,
1097 Debug,
1098 Clone,
1099 PartialEq,
1100 Eq,
1101 jacquard_derive::IntoStatic,
1102 Default
1103)]
1104#[serde(rename_all = "camelCase")]
1105pub struct ContentFormat<'a> {
1106 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1108 #[serde(borrow)]
1109 pub markdown: std::option::Option<jacquard_common::CowStr<'a>>,
1110}
1111
1112impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> {
1113 fn nsid() -> &'static str {
1114 "sh.weaver.notebook.defs"
1115 }
1116 fn def_name() -> &'static str {
1117 "contentFormat"
1118 }
1119 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1120 lexicon_doc_sh_weaver_notebook_defs()
1121 }
1122 fn validate(
1123 &self,
1124 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1125 Ok(())
1126 }
1127}
1128
1129#[jacquard_derive::lexicon]
1130#[derive(
1131 serde::Serialize,
1132 serde::Deserialize,
1133 Debug,
1134 Clone,
1135 PartialEq,
1136 Eq,
1137 jacquard_derive::IntoStatic
1138)]
1139#[serde(rename_all = "camelCase")]
1140pub struct EntryView<'a> {
1141 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1142 #[serde(borrow)]
1143 pub authors: Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1144 #[serde(borrow)]
1145 pub cid: jacquard_common::types::string::Cid<'a>,
1146 pub indexed_at: jacquard_common::types::string::Datetime,
1147 #[serde(borrow)]
1148 pub record: jacquard_common::types::value::Data<'a>,
1149 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1150 #[serde(borrow)]
1151 pub rendered_view: Option<crate::sh_weaver::notebook::RenderedView<'a>>,
1152 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1153 #[serde(borrow)]
1154 pub tags: Option<crate::sh_weaver::notebook::Tags<'a>>,
1155 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1156 #[serde(borrow)]
1157 pub title: Option<crate::sh_weaver::notebook::Title<'a>>,
1158 #[serde(borrow)]
1159 pub uri: jacquard_common::types::string::AtUri<'a>,
1160}
1161
1162pub mod entry_view_state {
1163
1164 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1165 #[allow(unused)]
1166 use ::core::marker::PhantomData;
1167 mod sealed {
1168 pub trait Sealed {}
1169 }
1170 pub trait State: sealed::Sealed {
1172 type Uri;
1173 type Cid;
1174 type Author;
1175 type Record;
1176 type IndexedAt;
1177 }
1178 pub struct Empty(());
1180 impl sealed::Sealed for Empty {}
1181 impl State for Empty {
1182 type Uri = Unset;
1183 type Cid = Unset;
1184 type Author = Unset;
1185 type Record = Unset;
1186 type IndexedAt = Unset;
1187 }
1188 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
1190 impl<S: State> sealed::Sealed for SetUri<S> {}
1191 impl<S: State> State for SetUri<S> {
1192 type Uri = Set<members::uri>;
1193 type Cid = S::Cid;
1194 type Author = S::Author;
1195 type Record = S::Record;
1196 type IndexedAt = S::IndexedAt;
1197 }
1198 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
1200 impl<S: State> sealed::Sealed for SetCid<S> {}
1201 impl<S: State> State for SetCid<S> {
1202 type Uri = S::Uri;
1203 type Cid = Set<members::cid>;
1204 type Author = S::Author;
1205 type Record = S::Record;
1206 type IndexedAt = S::IndexedAt;
1207 }
1208 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
1210 impl<S: State> sealed::Sealed for SetAuthor<S> {}
1211 impl<S: State> State for SetAuthor<S> {
1212 type Uri = S::Uri;
1213 type Cid = S::Cid;
1214 type Author = Set<members::author>;
1215 type Record = S::Record;
1216 type IndexedAt = S::IndexedAt;
1217 }
1218 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
1220 impl<S: State> sealed::Sealed for SetRecord<S> {}
1221 impl<S: State> State for SetRecord<S> {
1222 type Uri = S::Uri;
1223 type Cid = S::Cid;
1224 type Author = S::Author;
1225 type Record = Set<members::record>;
1226 type IndexedAt = S::IndexedAt;
1227 }
1228 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
1230 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
1231 impl<S: State> State for SetIndexedAt<S> {
1232 type Uri = S::Uri;
1233 type Cid = S::Cid;
1234 type Author = S::Author;
1235 type Record = S::Record;
1236 type IndexedAt = Set<members::indexed_at>;
1237 }
1238 #[allow(non_camel_case_types)]
1240 pub mod members {
1241 pub struct uri(());
1243 pub struct cid(());
1245 pub struct author(());
1247 pub struct record(());
1249 pub struct indexed_at(());
1251 }
1252}
1253
1254pub struct EntryViewBuilder<'a, S: entry_view_state::State> {
1256 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1257 __unsafe_private_named: (
1258 ::core::option::Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1259 ::core::option::Option<jacquard_common::types::string::Cid<'a>>,
1260 ::core::option::Option<jacquard_common::types::string::Datetime>,
1261 ::core::option::Option<jacquard_common::types::value::Data<'a>>,
1262 ::core::option::Option<crate::sh_weaver::notebook::RenderedView<'a>>,
1263 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
1264 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
1265 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
1266 ),
1267 _phantom: ::core::marker::PhantomData<&'a ()>,
1268}
1269
1270impl<'a> EntryView<'a> {
1271 pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> {
1273 EntryViewBuilder::new()
1274 }
1275}
1276
1277impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> {
1278 pub fn new() -> Self {
1280 EntryViewBuilder {
1281 _phantom_state: ::core::marker::PhantomData,
1282 __unsafe_private_named: (None, None, None, None, None, None, None, None),
1283 _phantom: ::core::marker::PhantomData,
1284 }
1285 }
1286}
1287
1288impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
1289 pub fn authors(
1291 mut self,
1292 value: impl Into<Option<crate::sh_weaver::notebook::AuthorListView<'a>>>,
1293 ) -> Self {
1294 self.__unsafe_private_named.0 = value.into();
1295 self
1296 }
1297 pub fn maybe_authors(
1299 mut self,
1300 value: Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1301 ) -> Self {
1302 self.__unsafe_private_named.0 = value;
1303 self
1304 }
1305}
1306
1307impl<'a, S> EntryViewBuilder<'a, S>
1308where
1309 S: entry_view_state::State,
1310 S::Cid: entry_view_state::IsUnset,
1311{
1312 pub fn cid(
1314 mut self,
1315 value: impl Into<jacquard_common::types::string::Cid<'a>>,
1316 ) -> EntryViewBuilder<'a, entry_view_state::SetCid<S>> {
1317 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1318 EntryViewBuilder {
1319 _phantom_state: ::core::marker::PhantomData,
1320 __unsafe_private_named: self.__unsafe_private_named,
1321 _phantom: ::core::marker::PhantomData,
1322 }
1323 }
1324}
1325
1326impl<'a, S> EntryViewBuilder<'a, S>
1327where
1328 S: entry_view_state::State,
1329 S::IndexedAt: entry_view_state::IsUnset,
1330{
1331 pub fn indexed_at(
1333 mut self,
1334 value: impl Into<jacquard_common::types::string::Datetime>,
1335 ) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt<S>> {
1336 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
1337 EntryViewBuilder {
1338 _phantom_state: ::core::marker::PhantomData,
1339 __unsafe_private_named: self.__unsafe_private_named,
1340 _phantom: ::core::marker::PhantomData,
1341 }
1342 }
1343}
1344
1345impl<'a, S> EntryViewBuilder<'a, S>
1346where
1347 S: entry_view_state::State,
1348 S::Record: entry_view_state::IsUnset,
1349{
1350 pub fn record(
1352 mut self,
1353 value: impl Into<jacquard_common::types::value::Data<'a>>,
1354 ) -> EntryViewBuilder<'a, entry_view_state::SetRecord<S>> {
1355 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
1356 EntryViewBuilder {
1357 _phantom_state: ::core::marker::PhantomData,
1358 __unsafe_private_named: self.__unsafe_private_named,
1359 _phantom: ::core::marker::PhantomData,
1360 }
1361 }
1362}
1363
1364impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
1365 pub fn rendered_view(
1367 mut self,
1368 value: impl Into<Option<crate::sh_weaver::notebook::RenderedView<'a>>>,
1369 ) -> Self {
1370 self.__unsafe_private_named.4 = value.into();
1371 self
1372 }
1373 pub fn maybe_rendered_view(
1375 mut self,
1376 value: Option<crate::sh_weaver::notebook::RenderedView<'a>>,
1377 ) -> Self {
1378 self.__unsafe_private_named.4 = value;
1379 self
1380 }
1381}
1382
1383impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
1384 pub fn tags(
1386 mut self,
1387 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
1388 ) -> Self {
1389 self.__unsafe_private_named.5 = value.into();
1390 self
1391 }
1392 pub fn maybe_tags(
1394 mut self,
1395 value: Option<crate::sh_weaver::notebook::Tags<'a>>,
1396 ) -> Self {
1397 self.__unsafe_private_named.5 = value;
1398 self
1399 }
1400}
1401
1402impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> {
1403 pub fn title(
1405 mut self,
1406 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
1407 ) -> Self {
1408 self.__unsafe_private_named.6 = value.into();
1409 self
1410 }
1411 pub fn maybe_title(
1413 mut self,
1414 value: Option<crate::sh_weaver::notebook::Title<'a>>,
1415 ) -> Self {
1416 self.__unsafe_private_named.6 = value;
1417 self
1418 }
1419}
1420
1421impl<'a, S> EntryViewBuilder<'a, S>
1422where
1423 S: entry_view_state::State,
1424 S::Uri: entry_view_state::IsUnset,
1425{
1426 pub fn uri(
1428 mut self,
1429 value: impl Into<jacquard_common::types::string::AtUri<'a>>,
1430 ) -> EntryViewBuilder<'a, entry_view_state::SetUri<S>> {
1431 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
1432 EntryViewBuilder {
1433 _phantom_state: ::core::marker::PhantomData,
1434 __unsafe_private_named: self.__unsafe_private_named,
1435 _phantom: ::core::marker::PhantomData,
1436 }
1437 }
1438}
1439
1440impl<'a, S> EntryViewBuilder<'a, S>
1441where
1442 S: entry_view_state::State,
1443 S::Uri: entry_view_state::IsSet,
1444 S::Cid: entry_view_state::IsSet,
1445 S::Author: entry_view_state::IsSet,
1446 S::Record: entry_view_state::IsSet,
1447 S::IndexedAt: entry_view_state::IsSet,
1448{
1449 pub fn build(self) -> EntryView<'a> {
1451 EntryView {
1452 authors: self.__unsafe_private_named.0,
1453 cid: self.__unsafe_private_named.1.unwrap(),
1454 indexed_at: self.__unsafe_private_named.2.unwrap(),
1455 record: self.__unsafe_private_named.3.unwrap(),
1456 rendered_view: self.__unsafe_private_named.4,
1457 tags: self.__unsafe_private_named.5,
1458 title: self.__unsafe_private_named.6,
1459 uri: self.__unsafe_private_named.7.unwrap(),
1460 extra_data: Default::default(),
1461 }
1462 }
1463 pub fn build_with_data(
1465 self,
1466 extra_data: std::collections::BTreeMap<
1467 jacquard_common::smol_str::SmolStr,
1468 jacquard_common::types::value::Data<'a>,
1469 >,
1470 ) -> EntryView<'a> {
1471 EntryView {
1472 authors: self.__unsafe_private_named.0,
1473 cid: self.__unsafe_private_named.1.unwrap(),
1474 indexed_at: self.__unsafe_private_named.2.unwrap(),
1475 record: self.__unsafe_private_named.3.unwrap(),
1476 rendered_view: self.__unsafe_private_named.4,
1477 tags: self.__unsafe_private_named.5,
1478 title: self.__unsafe_private_named.6,
1479 uri: self.__unsafe_private_named.7.unwrap(),
1480 extra_data: Some(extra_data),
1481 }
1482 }
1483}
1484
1485impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> {
1486 fn nsid() -> &'static str {
1487 "sh.weaver.notebook.defs"
1488 }
1489 fn def_name() -> &'static str {
1490 "entryView"
1491 }
1492 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1493 lexicon_doc_sh_weaver_notebook_defs()
1494 }
1495 fn validate(
1496 &self,
1497 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1498 Ok(())
1499 }
1500}
1501
1502#[jacquard_derive::lexicon]
1503#[derive(
1504 serde::Serialize,
1505 serde::Deserialize,
1506 Debug,
1507 Clone,
1508 PartialEq,
1509 Eq,
1510 jacquard_derive::IntoStatic
1511)]
1512#[serde(rename_all = "camelCase")]
1513pub struct NotebookView<'a> {
1514 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1515 #[serde(borrow)]
1516 pub authors: Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1517 #[serde(borrow)]
1518 pub cid: jacquard_common::types::string::Cid<'a>,
1519 pub indexed_at: jacquard_common::types::string::Datetime,
1520 #[serde(borrow)]
1521 pub record: jacquard_common::types::value::Data<'a>,
1522 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1523 #[serde(borrow)]
1524 pub tags: Option<crate::sh_weaver::notebook::Tags<'a>>,
1525 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1526 #[serde(borrow)]
1527 pub title: Option<crate::sh_weaver::notebook::Title<'a>>,
1528 #[serde(borrow)]
1529 pub uri: jacquard_common::types::string::AtUri<'a>,
1530}
1531
1532pub mod notebook_view_state {
1533
1534 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1535 #[allow(unused)]
1536 use ::core::marker::PhantomData;
1537 mod sealed {
1538 pub trait Sealed {}
1539 }
1540 pub trait State: sealed::Sealed {
1542 type Uri;
1543 type Cid;
1544 type Author;
1545 type Record;
1546 type IndexedAt;
1547 }
1548 pub struct Empty(());
1550 impl sealed::Sealed for Empty {}
1551 impl State for Empty {
1552 type Uri = Unset;
1553 type Cid = Unset;
1554 type Author = Unset;
1555 type Record = Unset;
1556 type IndexedAt = Unset;
1557 }
1558 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
1560 impl<S: State> sealed::Sealed for SetUri<S> {}
1561 impl<S: State> State for SetUri<S> {
1562 type Uri = Set<members::uri>;
1563 type Cid = S::Cid;
1564 type Author = S::Author;
1565 type Record = S::Record;
1566 type IndexedAt = S::IndexedAt;
1567 }
1568 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
1570 impl<S: State> sealed::Sealed for SetCid<S> {}
1571 impl<S: State> State for SetCid<S> {
1572 type Uri = S::Uri;
1573 type Cid = Set<members::cid>;
1574 type Author = S::Author;
1575 type Record = S::Record;
1576 type IndexedAt = S::IndexedAt;
1577 }
1578 pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
1580 impl<S: State> sealed::Sealed for SetAuthor<S> {}
1581 impl<S: State> State for SetAuthor<S> {
1582 type Uri = S::Uri;
1583 type Cid = S::Cid;
1584 type Author = Set<members::author>;
1585 type Record = S::Record;
1586 type IndexedAt = S::IndexedAt;
1587 }
1588 pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
1590 impl<S: State> sealed::Sealed for SetRecord<S> {}
1591 impl<S: State> State for SetRecord<S> {
1592 type Uri = S::Uri;
1593 type Cid = S::Cid;
1594 type Author = S::Author;
1595 type Record = Set<members::record>;
1596 type IndexedAt = S::IndexedAt;
1597 }
1598 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
1600 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
1601 impl<S: State> State for SetIndexedAt<S> {
1602 type Uri = S::Uri;
1603 type Cid = S::Cid;
1604 type Author = S::Author;
1605 type Record = S::Record;
1606 type IndexedAt = Set<members::indexed_at>;
1607 }
1608 #[allow(non_camel_case_types)]
1610 pub mod members {
1611 pub struct uri(());
1613 pub struct cid(());
1615 pub struct author(());
1617 pub struct record(());
1619 pub struct indexed_at(());
1621 }
1622}
1623
1624pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> {
1626 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1627 __unsafe_private_named: (
1628 ::core::option::Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1629 ::core::option::Option<jacquard_common::types::string::Cid<'a>>,
1630 ::core::option::Option<jacquard_common::types::string::Datetime>,
1631 ::core::option::Option<jacquard_common::types::value::Data<'a>>,
1632 ::core::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
1633 ::core::option::Option<crate::sh_weaver::notebook::Title<'a>>,
1634 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
1635 ),
1636 _phantom: ::core::marker::PhantomData<&'a ()>,
1637}
1638
1639impl<'a> NotebookView<'a> {
1640 pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> {
1642 NotebookViewBuilder::new()
1643 }
1644}
1645
1646impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> {
1647 pub fn new() -> Self {
1649 NotebookViewBuilder {
1650 _phantom_state: ::core::marker::PhantomData,
1651 __unsafe_private_named: (None, None, None, None, None, None, None),
1652 _phantom: ::core::marker::PhantomData,
1653 }
1654 }
1655}
1656
1657impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
1658 pub fn authors(
1660 mut self,
1661 value: impl Into<Option<crate::sh_weaver::notebook::AuthorListView<'a>>>,
1662 ) -> Self {
1663 self.__unsafe_private_named.0 = value.into();
1664 self
1665 }
1666 pub fn maybe_authors(
1668 mut self,
1669 value: Option<crate::sh_weaver::notebook::AuthorListView<'a>>,
1670 ) -> Self {
1671 self.__unsafe_private_named.0 = value;
1672 self
1673 }
1674}
1675
1676impl<'a, S> NotebookViewBuilder<'a, S>
1677where
1678 S: notebook_view_state::State,
1679 S::Cid: notebook_view_state::IsUnset,
1680{
1681 pub fn cid(
1683 mut self,
1684 value: impl Into<jacquard_common::types::string::Cid<'a>>,
1685 ) -> NotebookViewBuilder<'a, notebook_view_state::SetCid<S>> {
1686 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1687 NotebookViewBuilder {
1688 _phantom_state: ::core::marker::PhantomData,
1689 __unsafe_private_named: self.__unsafe_private_named,
1690 _phantom: ::core::marker::PhantomData,
1691 }
1692 }
1693}
1694
1695impl<'a, S> NotebookViewBuilder<'a, S>
1696where
1697 S: notebook_view_state::State,
1698 S::IndexedAt: notebook_view_state::IsUnset,
1699{
1700 pub fn indexed_at(
1702 mut self,
1703 value: impl Into<jacquard_common::types::string::Datetime>,
1704 ) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt<S>> {
1705 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
1706 NotebookViewBuilder {
1707 _phantom_state: ::core::marker::PhantomData,
1708 __unsafe_private_named: self.__unsafe_private_named,
1709 _phantom: ::core::marker::PhantomData,
1710 }
1711 }
1712}
1713
1714impl<'a, S> NotebookViewBuilder<'a, S>
1715where
1716 S: notebook_view_state::State,
1717 S::Record: notebook_view_state::IsUnset,
1718{
1719 pub fn record(
1721 mut self,
1722 value: impl Into<jacquard_common::types::value::Data<'a>>,
1723 ) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord<S>> {
1724 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
1725 NotebookViewBuilder {
1726 _phantom_state: ::core::marker::PhantomData,
1727 __unsafe_private_named: self.__unsafe_private_named,
1728 _phantom: ::core::marker::PhantomData,
1729 }
1730 }
1731}
1732
1733impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
1734 pub fn tags(
1736 mut self,
1737 value: impl Into<Option<crate::sh_weaver::notebook::Tags<'a>>>,
1738 ) -> Self {
1739 self.__unsafe_private_named.4 = value.into();
1740 self
1741 }
1742 pub fn maybe_tags(
1744 mut self,
1745 value: Option<crate::sh_weaver::notebook::Tags<'a>>,
1746 ) -> Self {
1747 self.__unsafe_private_named.4 = value;
1748 self
1749 }
1750}
1751
1752impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> {
1753 pub fn title(
1755 mut self,
1756 value: impl Into<Option<crate::sh_weaver::notebook::Title<'a>>>,
1757 ) -> Self {
1758 self.__unsafe_private_named.5 = value.into();
1759 self
1760 }
1761 pub fn maybe_title(
1763 mut self,
1764 value: Option<crate::sh_weaver::notebook::Title<'a>>,
1765 ) -> Self {
1766 self.__unsafe_private_named.5 = value;
1767 self
1768 }
1769}
1770
1771impl<'a, S> NotebookViewBuilder<'a, S>
1772where
1773 S: notebook_view_state::State,
1774 S::Uri: notebook_view_state::IsUnset,
1775{
1776 pub fn uri(
1778 mut self,
1779 value: impl Into<jacquard_common::types::string::AtUri<'a>>,
1780 ) -> NotebookViewBuilder<'a, notebook_view_state::SetUri<S>> {
1781 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
1782 NotebookViewBuilder {
1783 _phantom_state: ::core::marker::PhantomData,
1784 __unsafe_private_named: self.__unsafe_private_named,
1785 _phantom: ::core::marker::PhantomData,
1786 }
1787 }
1788}
1789
1790impl<'a, S> NotebookViewBuilder<'a, S>
1791where
1792 S: notebook_view_state::State,
1793 S::Uri: notebook_view_state::IsSet,
1794 S::Cid: notebook_view_state::IsSet,
1795 S::Author: notebook_view_state::IsSet,
1796 S::Record: notebook_view_state::IsSet,
1797 S::IndexedAt: notebook_view_state::IsSet,
1798{
1799 pub fn build(self) -> NotebookView<'a> {
1801 NotebookView {
1802 authors: self.__unsafe_private_named.0,
1803 cid: self.__unsafe_private_named.1.unwrap(),
1804 indexed_at: self.__unsafe_private_named.2.unwrap(),
1805 record: self.__unsafe_private_named.3.unwrap(),
1806 tags: self.__unsafe_private_named.4,
1807 title: self.__unsafe_private_named.5,
1808 uri: self.__unsafe_private_named.6.unwrap(),
1809 extra_data: Default::default(),
1810 }
1811 }
1812 pub fn build_with_data(
1814 self,
1815 extra_data: std::collections::BTreeMap<
1816 jacquard_common::smol_str::SmolStr,
1817 jacquard_common::types::value::Data<'a>,
1818 >,
1819 ) -> NotebookView<'a> {
1820 NotebookView {
1821 authors: self.__unsafe_private_named.0,
1822 cid: self.__unsafe_private_named.1.unwrap(),
1823 indexed_at: self.__unsafe_private_named.2.unwrap(),
1824 record: self.__unsafe_private_named.3.unwrap(),
1825 tags: self.__unsafe_private_named.4,
1826 title: self.__unsafe_private_named.5,
1827 uri: self.__unsafe_private_named.6.unwrap(),
1828 extra_data: Some(extra_data),
1829 }
1830 }
1831}
1832
1833impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> {
1834 fn nsid() -> &'static str {
1835 "sh.weaver.notebook.defs"
1836 }
1837 fn def_name() -> &'static str {
1838 "notebookView"
1839 }
1840 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1841 lexicon_doc_sh_weaver_notebook_defs()
1842 }
1843 fn validate(
1844 &self,
1845 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1846 Ok(())
1847 }
1848}
1849
1850#[jacquard_derive::lexicon]
1852#[derive(
1853 serde::Serialize,
1854 serde::Deserialize,
1855 Debug,
1856 Clone,
1857 PartialEq,
1858 Eq,
1859 jacquard_derive::IntoStatic
1860)]
1861#[serde(rename_all = "camelCase")]
1862pub struct RenderedView<'a> {
1863 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1864 #[serde(borrow)]
1865 pub css: Option<jacquard_common::types::blob::BlobRef<'a>>,
1866 #[serde(borrow)]
1867 pub html: jacquard_common::types::blob::BlobRef<'a>,
1868}
1869
1870pub mod rendered_view_state {
1871
1872 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1873 #[allow(unused)]
1874 use ::core::marker::PhantomData;
1875 mod sealed {
1876 pub trait Sealed {}
1877 }
1878 pub trait State: sealed::Sealed {
1880 type Html;
1881 }
1882 pub struct Empty(());
1884 impl sealed::Sealed for Empty {}
1885 impl State for Empty {
1886 type Html = Unset;
1887 }
1888 pub struct SetHtml<S: State = Empty>(PhantomData<fn() -> S>);
1890 impl<S: State> sealed::Sealed for SetHtml<S> {}
1891 impl<S: State> State for SetHtml<S> {
1892 type Html = Set<members::html>;
1893 }
1894 #[allow(non_camel_case_types)]
1896 pub mod members {
1897 pub struct html(());
1899 }
1900}
1901
1902pub struct RenderedViewBuilder<'a, S: rendered_view_state::State> {
1904 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1905 __unsafe_private_named: (
1906 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
1907 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
1908 ),
1909 _phantom: ::core::marker::PhantomData<&'a ()>,
1910}
1911
1912impl<'a> RenderedView<'a> {
1913 pub fn new() -> RenderedViewBuilder<'a, rendered_view_state::Empty> {
1915 RenderedViewBuilder::new()
1916 }
1917}
1918
1919impl<'a> RenderedViewBuilder<'a, rendered_view_state::Empty> {
1920 pub fn new() -> Self {
1922 RenderedViewBuilder {
1923 _phantom_state: ::core::marker::PhantomData,
1924 __unsafe_private_named: (None, None),
1925 _phantom: ::core::marker::PhantomData,
1926 }
1927 }
1928}
1929
1930impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> {
1931 pub fn css(
1933 mut self,
1934 value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>,
1935 ) -> Self {
1936 self.__unsafe_private_named.0 = value.into();
1937 self
1938 }
1939 pub fn maybe_css(
1941 mut self,
1942 value: Option<jacquard_common::types::blob::BlobRef<'a>>,
1943 ) -> Self {
1944 self.__unsafe_private_named.0 = value;
1945 self
1946 }
1947}
1948
1949impl<'a, S> RenderedViewBuilder<'a, S>
1950where
1951 S: rendered_view_state::State,
1952 S::Html: rendered_view_state::IsUnset,
1953{
1954 pub fn html(
1956 mut self,
1957 value: impl Into<jacquard_common::types::blob::BlobRef<'a>>,
1958 ) -> RenderedViewBuilder<'a, rendered_view_state::SetHtml<S>> {
1959 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1960 RenderedViewBuilder {
1961 _phantom_state: ::core::marker::PhantomData,
1962 __unsafe_private_named: self.__unsafe_private_named,
1963 _phantom: ::core::marker::PhantomData,
1964 }
1965 }
1966}
1967
1968impl<'a, S> RenderedViewBuilder<'a, S>
1969where
1970 S: rendered_view_state::State,
1971 S::Html: rendered_view_state::IsSet,
1972{
1973 pub fn build(self) -> RenderedView<'a> {
1975 RenderedView {
1976 css: self.__unsafe_private_named.0,
1977 html: self.__unsafe_private_named.1.unwrap(),
1978 extra_data: Default::default(),
1979 }
1980 }
1981 pub fn build_with_data(
1983 self,
1984 extra_data: std::collections::BTreeMap<
1985 jacquard_common::smol_str::SmolStr,
1986 jacquard_common::types::value::Data<'a>,
1987 >,
1988 ) -> RenderedView<'a> {
1989 RenderedView {
1990 css: self.__unsafe_private_named.0,
1991 html: self.__unsafe_private_named.1.unwrap(),
1992 extra_data: Some(extra_data),
1993 }
1994 }
1995}
1996
1997impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> {
1998 fn nsid() -> &'static str {
1999 "sh.weaver.notebook.defs"
2000 }
2001 fn def_name() -> &'static str {
2002 "renderedView"
2003 }
2004 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
2005 lexicon_doc_sh_weaver_notebook_defs()
2006 }
2007 fn validate(
2008 &self,
2009 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
2010 Ok(())
2011 }
2012}
2013
2014pub type Tags<'a> = Vec<jacquard_common::CowStr<'a>>;
2016pub type Title<'a> = jacquard_common::CowStr<'a>;