Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place
at main 51 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: place.wisp.subfs 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[jacquard_derive::lexicon] 9#[derive( 10 serde::Serialize, 11 serde::Deserialize, 12 Debug, 13 Clone, 14 PartialEq, 15 Eq, 16 jacquard_derive::IntoStatic 17)] 18#[serde(rename_all = "camelCase")] 19pub struct Directory<'a> { 20 #[serde(borrow)] 21 pub entries: Vec<crate::place_wisp::subfs::Entry<'a>>, 22 #[serde(borrow)] 23 pub r#type: jacquard_common::CowStr<'a>, 24} 25 26pub mod directory_state { 27 28 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 29 #[allow(unused)] 30 use ::core::marker::PhantomData; 31 mod sealed { 32 pub trait Sealed {} 33 } 34 /// State trait tracking which required fields have been set 35 pub trait State: sealed::Sealed { 36 type Type; 37 type Entries; 38 } 39 /// Empty state - all required fields are unset 40 pub struct Empty(()); 41 impl sealed::Sealed for Empty {} 42 impl State for Empty { 43 type Type = Unset; 44 type Entries = Unset; 45 } 46 ///State transition - sets the `type` field to Set 47 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 48 impl<S: State> sealed::Sealed for SetType<S> {} 49 impl<S: State> State for SetType<S> { 50 type Type = Set<members::r#type>; 51 type Entries = S::Entries; 52 } 53 ///State transition - sets the `entries` field to Set 54 pub struct SetEntries<S: State = Empty>(PhantomData<fn() -> S>); 55 impl<S: State> sealed::Sealed for SetEntries<S> {} 56 impl<S: State> State for SetEntries<S> { 57 type Type = S::Type; 58 type Entries = Set<members::entries>; 59 } 60 /// Marker types for field names 61 #[allow(non_camel_case_types)] 62 pub mod members { 63 ///Marker type for the `type` field 64 pub struct r#type(()); 65 ///Marker type for the `entries` field 66 pub struct entries(()); 67 } 68} 69 70/// Builder for constructing an instance of this type 71pub struct DirectoryBuilder<'a, S: directory_state::State> { 72 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 73 __unsafe_private_named: ( 74 ::core::option::Option<Vec<crate::place_wisp::subfs::Entry<'a>>>, 75 ::core::option::Option<jacquard_common::CowStr<'a>>, 76 ), 77 _phantom: ::core::marker::PhantomData<&'a ()>, 78} 79 80impl<'a> Directory<'a> { 81 /// Create a new builder for this type 82 pub fn new() -> DirectoryBuilder<'a, directory_state::Empty> { 83 DirectoryBuilder::new() 84 } 85} 86 87impl<'a> DirectoryBuilder<'a, directory_state::Empty> { 88 /// Create a new builder with all fields unset 89 pub fn new() -> Self { 90 DirectoryBuilder { 91 _phantom_state: ::core::marker::PhantomData, 92 __unsafe_private_named: (None, None), 93 _phantom: ::core::marker::PhantomData, 94 } 95 } 96} 97 98impl<'a, S> DirectoryBuilder<'a, S> 99where 100 S: directory_state::State, 101 S::Entries: directory_state::IsUnset, 102{ 103 /// Set the `entries` field (required) 104 pub fn entries( 105 mut self, 106 value: impl Into<Vec<crate::place_wisp::subfs::Entry<'a>>>, 107 ) -> DirectoryBuilder<'a, directory_state::SetEntries<S>> { 108 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 109 DirectoryBuilder { 110 _phantom_state: ::core::marker::PhantomData, 111 __unsafe_private_named: self.__unsafe_private_named, 112 _phantom: ::core::marker::PhantomData, 113 } 114 } 115} 116 117impl<'a, S> DirectoryBuilder<'a, S> 118where 119 S: directory_state::State, 120 S::Type: directory_state::IsUnset, 121{ 122 /// Set the `type` field (required) 123 pub fn r#type( 124 mut self, 125 value: impl Into<jacquard_common::CowStr<'a>>, 126 ) -> DirectoryBuilder<'a, directory_state::SetType<S>> { 127 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 128 DirectoryBuilder { 129 _phantom_state: ::core::marker::PhantomData, 130 __unsafe_private_named: self.__unsafe_private_named, 131 _phantom: ::core::marker::PhantomData, 132 } 133 } 134} 135 136impl<'a, S> DirectoryBuilder<'a, S> 137where 138 S: directory_state::State, 139 S::Type: directory_state::IsSet, 140 S::Entries: directory_state::IsSet, 141{ 142 /// Build the final struct 143 pub fn build(self) -> Directory<'a> { 144 Directory { 145 entries: self.__unsafe_private_named.0.unwrap(), 146 r#type: self.__unsafe_private_named.1.unwrap(), 147 extra_data: Default::default(), 148 } 149 } 150 /// Build the final struct with custom extra_data 151 pub fn build_with_data( 152 self, 153 extra_data: std::collections::BTreeMap< 154 jacquard_common::smol_str::SmolStr, 155 jacquard_common::types::value::Data<'a>, 156 >, 157 ) -> Directory<'a> { 158 Directory { 159 entries: self.__unsafe_private_named.0.unwrap(), 160 r#type: self.__unsafe_private_named.1.unwrap(), 161 extra_data: Some(extra_data), 162 } 163 } 164} 165 166fn lexicon_doc_place_wisp_subfs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 167 ::jacquard_lexicon::lexicon::LexiconDoc { 168 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 169 id: ::jacquard_common::CowStr::new_static("place.wisp.subfs"), 170 revision: None, 171 description: None, 172 defs: { 173 let mut map = ::std::collections::BTreeMap::new(); 174 map.insert( 175 ::jacquard_common::smol_str::SmolStr::new_static("directory"), 176 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 177 description: None, 178 required: Some( 179 vec![ 180 ::jacquard_common::smol_str::SmolStr::new_static("type"), 181 ::jacquard_common::smol_str::SmolStr::new_static("entries") 182 ], 183 ), 184 nullable: None, 185 properties: { 186 #[allow(unused_mut)] 187 let mut map = ::std::collections::BTreeMap::new(); 188 map.insert( 189 ::jacquard_common::smol_str::SmolStr::new_static("entries"), 190 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 191 description: None, 192 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 193 description: None, 194 r#ref: ::jacquard_common::CowStr::new_static("#entry"), 195 }), 196 min_length: None, 197 max_length: Some(500usize), 198 }), 199 ); 200 map.insert( 201 ::jacquard_common::smol_str::SmolStr::new_static("type"), 202 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 203 description: None, 204 format: None, 205 default: None, 206 min_length: None, 207 max_length: None, 208 min_graphemes: None, 209 max_graphemes: None, 210 r#enum: None, 211 r#const: None, 212 known_values: None, 213 }), 214 ); 215 map 216 }, 217 }), 218 ); 219 map.insert( 220 ::jacquard_common::smol_str::SmolStr::new_static("entry"), 221 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 222 description: None, 223 required: Some( 224 vec![ 225 ::jacquard_common::smol_str::SmolStr::new_static("name"), 226 ::jacquard_common::smol_str::SmolStr::new_static("node") 227 ], 228 ), 229 nullable: None, 230 properties: { 231 #[allow(unused_mut)] 232 let mut map = ::std::collections::BTreeMap::new(); 233 map.insert( 234 ::jacquard_common::smol_str::SmolStr::new_static("name"), 235 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 236 description: None, 237 format: None, 238 default: None, 239 min_length: None, 240 max_length: Some(255usize), 241 min_graphemes: None, 242 max_graphemes: None, 243 r#enum: None, 244 r#const: None, 245 known_values: None, 246 }), 247 ); 248 map.insert( 249 ::jacquard_common::smol_str::SmolStr::new_static("node"), 250 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 251 description: None, 252 refs: vec![ 253 ::jacquard_common::CowStr::new_static("#file"), 254 ::jacquard_common::CowStr::new_static("#directory"), 255 ::jacquard_common::CowStr::new_static("#subfs") 256 ], 257 closed: None, 258 }), 259 ); 260 map 261 }, 262 }), 263 ); 264 map.insert( 265 ::jacquard_common::smol_str::SmolStr::new_static("file"), 266 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 267 description: None, 268 required: Some( 269 vec![ 270 ::jacquard_common::smol_str::SmolStr::new_static("type"), 271 ::jacquard_common::smol_str::SmolStr::new_static("blob") 272 ], 273 ), 274 nullable: None, 275 properties: { 276 #[allow(unused_mut)] 277 let mut map = ::std::collections::BTreeMap::new(); 278 map.insert( 279 ::jacquard_common::smol_str::SmolStr::new_static("base64"), 280 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 281 description: None, 282 default: None, 283 r#const: None, 284 }), 285 ); 286 map.insert( 287 ::jacquard_common::smol_str::SmolStr::new_static("blob"), 288 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 289 description: None, 290 accept: None, 291 max_size: None, 292 }), 293 ); 294 map.insert( 295 ::jacquard_common::smol_str::SmolStr::new_static("encoding"), 296 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 297 description: Some( 298 ::jacquard_common::CowStr::new_static( 299 "Content encoding (e.g., gzip for compressed files)", 300 ), 301 ), 302 format: None, 303 default: None, 304 min_length: None, 305 max_length: None, 306 min_graphemes: None, 307 max_graphemes: None, 308 r#enum: None, 309 r#const: None, 310 known_values: None, 311 }), 312 ); 313 map.insert( 314 ::jacquard_common::smol_str::SmolStr::new_static("mimeType"), 315 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 316 description: Some( 317 ::jacquard_common::CowStr::new_static( 318 "Original MIME type before compression", 319 ), 320 ), 321 format: None, 322 default: None, 323 min_length: None, 324 max_length: None, 325 min_graphemes: None, 326 max_graphemes: None, 327 r#enum: None, 328 r#const: None, 329 known_values: None, 330 }), 331 ); 332 map.insert( 333 ::jacquard_common::smol_str::SmolStr::new_static("type"), 334 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 335 description: None, 336 format: None, 337 default: None, 338 min_length: None, 339 max_length: None, 340 min_graphemes: None, 341 max_graphemes: None, 342 r#enum: None, 343 r#const: None, 344 known_values: None, 345 }), 346 ); 347 map 348 }, 349 }), 350 ); 351 map.insert( 352 ::jacquard_common::smol_str::SmolStr::new_static("main"), 353 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 354 description: Some( 355 ::jacquard_common::CowStr::new_static( 356 "Virtual filesystem subtree referenced by place.wisp.fs records. When a subfs entry is expanded, its root entries are merged (flattened) into the parent directory, allowing large directories to be split across multiple records while maintaining a flat structure.", 357 ), 358 ), 359 key: None, 360 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 361 description: None, 362 required: Some( 363 vec![ 364 ::jacquard_common::smol_str::SmolStr::new_static("root"), 365 ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 366 ], 367 ), 368 nullable: None, 369 properties: { 370 #[allow(unused_mut)] 371 let mut map = ::std::collections::BTreeMap::new(); 372 map.insert( 373 ::jacquard_common::smol_str::SmolStr::new_static( 374 "createdAt", 375 ), 376 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 377 description: None, 378 format: Some( 379 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 380 ), 381 default: None, 382 min_length: None, 383 max_length: None, 384 min_graphemes: None, 385 max_graphemes: None, 386 r#enum: None, 387 r#const: None, 388 known_values: None, 389 }), 390 ); 391 map.insert( 392 ::jacquard_common::smol_str::SmolStr::new_static( 393 "fileCount", 394 ), 395 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 396 description: None, 397 default: None, 398 minimum: Some(0i64), 399 maximum: Some(1000i64), 400 r#enum: None, 401 r#const: None, 402 }), 403 ); 404 map.insert( 405 ::jacquard_common::smol_str::SmolStr::new_static("root"), 406 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 407 description: None, 408 r#ref: ::jacquard_common::CowStr::new_static("#directory"), 409 }), 410 ); 411 map 412 }, 413 }), 414 }), 415 ); 416 map.insert( 417 ::jacquard_common::smol_str::SmolStr::new_static("subfs"), 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("type"), 423 ::jacquard_common::smol_str::SmolStr::new_static("subject") 424 ], 425 ), 426 nullable: None, 427 properties: { 428 #[allow(unused_mut)] 429 let mut map = ::std::collections::BTreeMap::new(); 430 map.insert( 431 ::jacquard_common::smol_str::SmolStr::new_static("subject"), 432 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 433 description: Some( 434 ::jacquard_common::CowStr::new_static( 435 "AT-URI pointing to another place.wisp.subfs record for nested subtrees. When expanded, the referenced record's root entries are merged (flattened) into the parent directory, allowing recursive splitting of large directory structures.", 436 ), 437 ), 438 format: Some( 439 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 440 ), 441 default: None, 442 min_length: None, 443 max_length: None, 444 min_graphemes: None, 445 max_graphemes: None, 446 r#enum: None, 447 r#const: None, 448 known_values: None, 449 }), 450 ); 451 map.insert( 452 ::jacquard_common::smol_str::SmolStr::new_static("type"), 453 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 454 description: None, 455 format: None, 456 default: None, 457 min_length: None, 458 max_length: None, 459 min_graphemes: None, 460 max_graphemes: None, 461 r#enum: None, 462 r#const: None, 463 known_values: None, 464 }), 465 ); 466 map 467 }, 468 }), 469 ); 470 map 471 }, 472 } 473} 474 475impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Directory<'a> { 476 fn nsid() -> &'static str { 477 "place.wisp.subfs" 478 } 479 fn def_name() -> &'static str { 480 "directory" 481 } 482 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 483 lexicon_doc_place_wisp_subfs() 484 } 485 fn validate( 486 &self, 487 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 488 { 489 let value = &self.entries; 490 #[allow(unused_comparisons)] 491 if value.len() > 500usize { 492 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 493 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 494 "entries", 495 ), 496 max: 500usize, 497 actual: value.len(), 498 }); 499 } 500 } 501 Ok(()) 502 } 503} 504 505#[jacquard_derive::lexicon] 506#[derive( 507 serde::Serialize, 508 serde::Deserialize, 509 Debug, 510 Clone, 511 PartialEq, 512 Eq, 513 jacquard_derive::IntoStatic 514)] 515#[serde(rename_all = "camelCase")] 516pub struct Entry<'a> { 517 #[serde(borrow)] 518 pub name: jacquard_common::CowStr<'a>, 519 #[serde(borrow)] 520 pub node: EntryNode<'a>, 521} 522 523pub mod entry_state { 524 525 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 526 #[allow(unused)] 527 use ::core::marker::PhantomData; 528 mod sealed { 529 pub trait Sealed {} 530 } 531 /// State trait tracking which required fields have been set 532 pub trait State: sealed::Sealed { 533 type Name; 534 type Node; 535 } 536 /// Empty state - all required fields are unset 537 pub struct Empty(()); 538 impl sealed::Sealed for Empty {} 539 impl State for Empty { 540 type Name = Unset; 541 type Node = Unset; 542 } 543 ///State transition - sets the `name` field to Set 544 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 545 impl<S: State> sealed::Sealed for SetName<S> {} 546 impl<S: State> State for SetName<S> { 547 type Name = Set<members::name>; 548 type Node = S::Node; 549 } 550 ///State transition - sets the `node` field to Set 551 pub struct SetNode<S: State = Empty>(PhantomData<fn() -> S>); 552 impl<S: State> sealed::Sealed for SetNode<S> {} 553 impl<S: State> State for SetNode<S> { 554 type Name = S::Name; 555 type Node = Set<members::node>; 556 } 557 /// Marker types for field names 558 #[allow(non_camel_case_types)] 559 pub mod members { 560 ///Marker type for the `name` field 561 pub struct name(()); 562 ///Marker type for the `node` field 563 pub struct node(()); 564 } 565} 566 567/// Builder for constructing an instance of this type 568pub struct EntryBuilder<'a, S: entry_state::State> { 569 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 570 __unsafe_private_named: ( 571 ::core::option::Option<jacquard_common::CowStr<'a>>, 572 ::core::option::Option<EntryNode<'a>>, 573 ), 574 _phantom: ::core::marker::PhantomData<&'a ()>, 575} 576 577impl<'a> Entry<'a> { 578 /// Create a new builder for this type 579 pub fn new() -> EntryBuilder<'a, entry_state::Empty> { 580 EntryBuilder::new() 581 } 582} 583 584impl<'a> EntryBuilder<'a, entry_state::Empty> { 585 /// Create a new builder with all fields unset 586 pub fn new() -> Self { 587 EntryBuilder { 588 _phantom_state: ::core::marker::PhantomData, 589 __unsafe_private_named: (None, None), 590 _phantom: ::core::marker::PhantomData, 591 } 592 } 593} 594 595impl<'a, S> EntryBuilder<'a, S> 596where 597 S: entry_state::State, 598 S::Name: entry_state::IsUnset, 599{ 600 /// Set the `name` field (required) 601 pub fn name( 602 mut self, 603 value: impl Into<jacquard_common::CowStr<'a>>, 604 ) -> EntryBuilder<'a, entry_state::SetName<S>> { 605 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 606 EntryBuilder { 607 _phantom_state: ::core::marker::PhantomData, 608 __unsafe_private_named: self.__unsafe_private_named, 609 _phantom: ::core::marker::PhantomData, 610 } 611 } 612} 613 614impl<'a, S> EntryBuilder<'a, S> 615where 616 S: entry_state::State, 617 S::Node: entry_state::IsUnset, 618{ 619 /// Set the `node` field (required) 620 pub fn node( 621 mut self, 622 value: impl Into<EntryNode<'a>>, 623 ) -> EntryBuilder<'a, entry_state::SetNode<S>> { 624 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 625 EntryBuilder { 626 _phantom_state: ::core::marker::PhantomData, 627 __unsafe_private_named: self.__unsafe_private_named, 628 _phantom: ::core::marker::PhantomData, 629 } 630 } 631} 632 633impl<'a, S> EntryBuilder<'a, S> 634where 635 S: entry_state::State, 636 S::Name: entry_state::IsSet, 637 S::Node: entry_state::IsSet, 638{ 639 /// Build the final struct 640 pub fn build(self) -> Entry<'a> { 641 Entry { 642 name: self.__unsafe_private_named.0.unwrap(), 643 node: self.__unsafe_private_named.1.unwrap(), 644 extra_data: Default::default(), 645 } 646 } 647 /// Build the final struct with custom extra_data 648 pub fn build_with_data( 649 self, 650 extra_data: std::collections::BTreeMap< 651 jacquard_common::smol_str::SmolStr, 652 jacquard_common::types::value::Data<'a>, 653 >, 654 ) -> Entry<'a> { 655 Entry { 656 name: self.__unsafe_private_named.0.unwrap(), 657 node: self.__unsafe_private_named.1.unwrap(), 658 extra_data: Some(extra_data), 659 } 660 } 661} 662 663#[jacquard_derive::open_union] 664#[derive( 665 serde::Serialize, 666 serde::Deserialize, 667 Debug, 668 Clone, 669 PartialEq, 670 Eq, 671 jacquard_derive::IntoStatic 672)] 673#[serde(tag = "$type")] 674#[serde(bound(deserialize = "'de: 'a"))] 675pub enum EntryNode<'a> { 676 #[serde(rename = "place.wisp.subfs#file")] 677 File(Box<crate::place_wisp::subfs::File<'a>>), 678 #[serde(rename = "place.wisp.subfs#directory")] 679 Directory(Box<crate::place_wisp::subfs::Directory<'a>>), 680 #[serde(rename = "place.wisp.subfs#subfs")] 681 Subfs(Box<crate::place_wisp::subfs::Subfs<'a>>), 682} 683 684impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Entry<'a> { 685 fn nsid() -> &'static str { 686 "place.wisp.subfs" 687 } 688 fn def_name() -> &'static str { 689 "entry" 690 } 691 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 692 lexicon_doc_place_wisp_subfs() 693 } 694 fn validate( 695 &self, 696 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 697 { 698 let value = &self.name; 699 #[allow(unused_comparisons)] 700 if <str>::len(value.as_ref()) > 255usize { 701 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 702 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 703 "name", 704 ), 705 max: 255usize, 706 actual: <str>::len(value.as_ref()), 707 }); 708 } 709 } 710 Ok(()) 711 } 712} 713 714#[jacquard_derive::lexicon] 715#[derive( 716 serde::Serialize, 717 serde::Deserialize, 718 Debug, 719 Clone, 720 PartialEq, 721 Eq, 722 jacquard_derive::IntoStatic 723)] 724#[serde(rename_all = "camelCase")] 725pub struct File<'a> { 726 /// True if blob content is base64-encoded (used to bypass PDS content sniffing) 727 #[serde(skip_serializing_if = "std::option::Option::is_none")] 728 pub base64: Option<bool>, 729 /// Content blob ref 730 #[serde(borrow)] 731 pub blob: jacquard_common::types::blob::BlobRef<'a>, 732 /// Content encoding (e.g., gzip for compressed files) 733 #[serde(skip_serializing_if = "std::option::Option::is_none")] 734 #[serde(borrow)] 735 pub encoding: Option<jacquard_common::CowStr<'a>>, 736 /// Original MIME type before compression 737 #[serde(skip_serializing_if = "std::option::Option::is_none")] 738 #[serde(borrow)] 739 pub mime_type: Option<jacquard_common::CowStr<'a>>, 740 #[serde(borrow)] 741 pub r#type: jacquard_common::CowStr<'a>, 742} 743 744pub mod file_state { 745 746 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 747 #[allow(unused)] 748 use ::core::marker::PhantomData; 749 mod sealed { 750 pub trait Sealed {} 751 } 752 /// State trait tracking which required fields have been set 753 pub trait State: sealed::Sealed { 754 type Type; 755 type Blob; 756 } 757 /// Empty state - all required fields are unset 758 pub struct Empty(()); 759 impl sealed::Sealed for Empty {} 760 impl State for Empty { 761 type Type = Unset; 762 type Blob = Unset; 763 } 764 ///State transition - sets the `type` field to Set 765 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 766 impl<S: State> sealed::Sealed for SetType<S> {} 767 impl<S: State> State for SetType<S> { 768 type Type = Set<members::r#type>; 769 type Blob = S::Blob; 770 } 771 ///State transition - sets the `blob` field to Set 772 pub struct SetBlob<S: State = Empty>(PhantomData<fn() -> S>); 773 impl<S: State> sealed::Sealed for SetBlob<S> {} 774 impl<S: State> State for SetBlob<S> { 775 type Type = S::Type; 776 type Blob = Set<members::blob>; 777 } 778 /// Marker types for field names 779 #[allow(non_camel_case_types)] 780 pub mod members { 781 ///Marker type for the `type` field 782 pub struct r#type(()); 783 ///Marker type for the `blob` field 784 pub struct blob(()); 785 } 786} 787 788/// Builder for constructing an instance of this type 789pub struct FileBuilder<'a, S: file_state::State> { 790 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 791 __unsafe_private_named: ( 792 ::core::option::Option<bool>, 793 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 794 ::core::option::Option<jacquard_common::CowStr<'a>>, 795 ::core::option::Option<jacquard_common::CowStr<'a>>, 796 ::core::option::Option<jacquard_common::CowStr<'a>>, 797 ), 798 _phantom: ::core::marker::PhantomData<&'a ()>, 799} 800 801impl<'a> File<'a> { 802 /// Create a new builder for this type 803 pub fn new() -> FileBuilder<'a, file_state::Empty> { 804 FileBuilder::new() 805 } 806} 807 808impl<'a> FileBuilder<'a, file_state::Empty> { 809 /// Create a new builder with all fields unset 810 pub fn new() -> Self { 811 FileBuilder { 812 _phantom_state: ::core::marker::PhantomData, 813 __unsafe_private_named: (None, None, None, None, None), 814 _phantom: ::core::marker::PhantomData, 815 } 816 } 817} 818 819impl<'a, S: file_state::State> FileBuilder<'a, S> { 820 /// Set the `base64` field (optional) 821 pub fn base64(mut self, value: impl Into<Option<bool>>) -> Self { 822 self.__unsafe_private_named.0 = value.into(); 823 self 824 } 825 /// Set the `base64` field to an Option value (optional) 826 pub fn maybe_base64(mut self, value: Option<bool>) -> Self { 827 self.__unsafe_private_named.0 = value; 828 self 829 } 830} 831 832impl<'a, S> FileBuilder<'a, S> 833where 834 S: file_state::State, 835 S::Blob: file_state::IsUnset, 836{ 837 /// Set the `blob` field (required) 838 pub fn blob( 839 mut self, 840 value: impl Into<jacquard_common::types::blob::BlobRef<'a>>, 841 ) -> FileBuilder<'a, file_state::SetBlob<S>> { 842 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 843 FileBuilder { 844 _phantom_state: ::core::marker::PhantomData, 845 __unsafe_private_named: self.__unsafe_private_named, 846 _phantom: ::core::marker::PhantomData, 847 } 848 } 849} 850 851impl<'a, S: file_state::State> FileBuilder<'a, S> { 852 /// Set the `encoding` field (optional) 853 pub fn encoding( 854 mut self, 855 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 856 ) -> Self { 857 self.__unsafe_private_named.2 = value.into(); 858 self 859 } 860 /// Set the `encoding` field to an Option value (optional) 861 pub fn maybe_encoding(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 862 self.__unsafe_private_named.2 = value; 863 self 864 } 865} 866 867impl<'a, S: file_state::State> FileBuilder<'a, S> { 868 /// Set the `mimeType` field (optional) 869 pub fn mime_type( 870 mut self, 871 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 872 ) -> Self { 873 self.__unsafe_private_named.3 = value.into(); 874 self 875 } 876 /// Set the `mimeType` field to an Option value (optional) 877 pub fn maybe_mime_type( 878 mut self, 879 value: Option<jacquard_common::CowStr<'a>>, 880 ) -> Self { 881 self.__unsafe_private_named.3 = value; 882 self 883 } 884} 885 886impl<'a, S> FileBuilder<'a, S> 887where 888 S: file_state::State, 889 S::Type: file_state::IsUnset, 890{ 891 /// Set the `type` field (required) 892 pub fn r#type( 893 mut self, 894 value: impl Into<jacquard_common::CowStr<'a>>, 895 ) -> FileBuilder<'a, file_state::SetType<S>> { 896 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 897 FileBuilder { 898 _phantom_state: ::core::marker::PhantomData, 899 __unsafe_private_named: self.__unsafe_private_named, 900 _phantom: ::core::marker::PhantomData, 901 } 902 } 903} 904 905impl<'a, S> FileBuilder<'a, S> 906where 907 S: file_state::State, 908 S::Type: file_state::IsSet, 909 S::Blob: file_state::IsSet, 910{ 911 /// Build the final struct 912 pub fn build(self) -> File<'a> { 913 File { 914 base64: self.__unsafe_private_named.0, 915 blob: self.__unsafe_private_named.1.unwrap(), 916 encoding: self.__unsafe_private_named.2, 917 mime_type: self.__unsafe_private_named.3, 918 r#type: self.__unsafe_private_named.4.unwrap(), 919 extra_data: Default::default(), 920 } 921 } 922 /// Build the final struct with custom extra_data 923 pub fn build_with_data( 924 self, 925 extra_data: std::collections::BTreeMap< 926 jacquard_common::smol_str::SmolStr, 927 jacquard_common::types::value::Data<'a>, 928 >, 929 ) -> File<'a> { 930 File { 931 base64: self.__unsafe_private_named.0, 932 blob: self.__unsafe_private_named.1.unwrap(), 933 encoding: self.__unsafe_private_named.2, 934 mime_type: self.__unsafe_private_named.3, 935 r#type: self.__unsafe_private_named.4.unwrap(), 936 extra_data: Some(extra_data), 937 } 938 } 939} 940 941impl<'a> ::jacquard_lexicon::schema::LexiconSchema for File<'a> { 942 fn nsid() -> &'static str { 943 "place.wisp.subfs" 944 } 945 fn def_name() -> &'static str { 946 "file" 947 } 948 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 949 lexicon_doc_place_wisp_subfs() 950 } 951 fn validate( 952 &self, 953 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 954 Ok(()) 955 } 956} 957 958/// Virtual filesystem subtree referenced by place.wisp.fs records. When a subfs entry is expanded, its root entries are merged (flattened) into the parent directory, allowing large directories to be split across multiple records while maintaining a flat structure. 959#[jacquard_derive::lexicon] 960#[derive( 961 serde::Serialize, 962 serde::Deserialize, 963 Debug, 964 Clone, 965 PartialEq, 966 Eq, 967 jacquard_derive::IntoStatic 968)] 969#[serde(rename_all = "camelCase")] 970pub struct SubfsRecord<'a> { 971 pub created_at: jacquard_common::types::string::Datetime, 972 #[serde(skip_serializing_if = "std::option::Option::is_none")] 973 pub file_count: Option<i64>, 974 #[serde(borrow)] 975 pub root: crate::place_wisp::subfs::Directory<'a>, 976} 977 978pub mod subfs_record_state { 979 980 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 981 #[allow(unused)] 982 use ::core::marker::PhantomData; 983 mod sealed { 984 pub trait Sealed {} 985 } 986 /// State trait tracking which required fields have been set 987 pub trait State: sealed::Sealed { 988 type Root; 989 type CreatedAt; 990 } 991 /// Empty state - all required fields are unset 992 pub struct Empty(()); 993 impl sealed::Sealed for Empty {} 994 impl State for Empty { 995 type Root = Unset; 996 type CreatedAt = Unset; 997 } 998 ///State transition - sets the `root` field to Set 999 pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>); 1000 impl<S: State> sealed::Sealed for SetRoot<S> {} 1001 impl<S: State> State for SetRoot<S> { 1002 type Root = Set<members::root>; 1003 type CreatedAt = S::CreatedAt; 1004 } 1005 ///State transition - sets the `created_at` field to Set 1006 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 1007 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 1008 impl<S: State> State for SetCreatedAt<S> { 1009 type Root = S::Root; 1010 type CreatedAt = Set<members::created_at>; 1011 } 1012 /// Marker types for field names 1013 #[allow(non_camel_case_types)] 1014 pub mod members { 1015 ///Marker type for the `root` field 1016 pub struct root(()); 1017 ///Marker type for the `created_at` field 1018 pub struct created_at(()); 1019 } 1020} 1021 1022/// Builder for constructing an instance of this type 1023pub struct SubfsRecordBuilder<'a, S: subfs_record_state::State> { 1024 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1025 __unsafe_private_named: ( 1026 ::core::option::Option<jacquard_common::types::string::Datetime>, 1027 ::core::option::Option<i64>, 1028 ::core::option::Option<crate::place_wisp::subfs::Directory<'a>>, 1029 ), 1030 _phantom: ::core::marker::PhantomData<&'a ()>, 1031} 1032 1033impl<'a> SubfsRecord<'a> { 1034 /// Create a new builder for this type 1035 pub fn new() -> SubfsRecordBuilder<'a, subfs_record_state::Empty> { 1036 SubfsRecordBuilder::new() 1037 } 1038} 1039 1040impl<'a> SubfsRecordBuilder<'a, subfs_record_state::Empty> { 1041 /// Create a new builder with all fields unset 1042 pub fn new() -> Self { 1043 SubfsRecordBuilder { 1044 _phantom_state: ::core::marker::PhantomData, 1045 __unsafe_private_named: (None, None, None), 1046 _phantom: ::core::marker::PhantomData, 1047 } 1048 } 1049} 1050 1051impl<'a, S> SubfsRecordBuilder<'a, S> 1052where 1053 S: subfs_record_state::State, 1054 S::CreatedAt: subfs_record_state::IsUnset, 1055{ 1056 /// Set the `createdAt` field (required) 1057 pub fn created_at( 1058 mut self, 1059 value: impl Into<jacquard_common::types::string::Datetime>, 1060 ) -> SubfsRecordBuilder<'a, subfs_record_state::SetCreatedAt<S>> { 1061 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1062 SubfsRecordBuilder { 1063 _phantom_state: ::core::marker::PhantomData, 1064 __unsafe_private_named: self.__unsafe_private_named, 1065 _phantom: ::core::marker::PhantomData, 1066 } 1067 } 1068} 1069 1070impl<'a, S: subfs_record_state::State> SubfsRecordBuilder<'a, S> { 1071 /// Set the `fileCount` field (optional) 1072 pub fn file_count(mut self, value: impl Into<Option<i64>>) -> Self { 1073 self.__unsafe_private_named.1 = value.into(); 1074 self 1075 } 1076 /// Set the `fileCount` field to an Option value (optional) 1077 pub fn maybe_file_count(mut self, value: Option<i64>) -> Self { 1078 self.__unsafe_private_named.1 = value; 1079 self 1080 } 1081} 1082 1083impl<'a, S> SubfsRecordBuilder<'a, S> 1084where 1085 S: subfs_record_state::State, 1086 S::Root: subfs_record_state::IsUnset, 1087{ 1088 /// Set the `root` field (required) 1089 pub fn root( 1090 mut self, 1091 value: impl Into<crate::place_wisp::subfs::Directory<'a>>, 1092 ) -> SubfsRecordBuilder<'a, subfs_record_state::SetRoot<S>> { 1093 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1094 SubfsRecordBuilder { 1095 _phantom_state: ::core::marker::PhantomData, 1096 __unsafe_private_named: self.__unsafe_private_named, 1097 _phantom: ::core::marker::PhantomData, 1098 } 1099 } 1100} 1101 1102impl<'a, S> SubfsRecordBuilder<'a, S> 1103where 1104 S: subfs_record_state::State, 1105 S::Root: subfs_record_state::IsSet, 1106 S::CreatedAt: subfs_record_state::IsSet, 1107{ 1108 /// Build the final struct 1109 pub fn build(self) -> SubfsRecord<'a> { 1110 SubfsRecord { 1111 created_at: self.__unsafe_private_named.0.unwrap(), 1112 file_count: self.__unsafe_private_named.1, 1113 root: self.__unsafe_private_named.2.unwrap(), 1114 extra_data: Default::default(), 1115 } 1116 } 1117 /// Build the final struct with custom extra_data 1118 pub fn build_with_data( 1119 self, 1120 extra_data: std::collections::BTreeMap< 1121 jacquard_common::smol_str::SmolStr, 1122 jacquard_common::types::value::Data<'a>, 1123 >, 1124 ) -> SubfsRecord<'a> { 1125 SubfsRecord { 1126 created_at: self.__unsafe_private_named.0.unwrap(), 1127 file_count: self.__unsafe_private_named.1, 1128 root: self.__unsafe_private_named.2.unwrap(), 1129 extra_data: Some(extra_data), 1130 } 1131 } 1132} 1133 1134impl<'a> SubfsRecord<'a> { 1135 pub fn uri( 1136 uri: impl Into<jacquard_common::CowStr<'a>>, 1137 ) -> Result< 1138 jacquard_common::types::uri::RecordUri<'a, SubfsRecordRecord>, 1139 jacquard_common::types::uri::UriError, 1140 > { 1141 jacquard_common::types::uri::RecordUri::try_from_uri( 1142 jacquard_common::types::string::AtUri::new_cow(uri.into())?, 1143 ) 1144 } 1145} 1146 1147/// Typed wrapper for GetRecord response with this collection's record type. 1148#[derive( 1149 serde::Serialize, 1150 serde::Deserialize, 1151 Debug, 1152 Clone, 1153 PartialEq, 1154 Eq, 1155 jacquard_derive::IntoStatic 1156)] 1157#[serde(rename_all = "camelCase")] 1158pub struct SubfsRecordGetRecordOutput<'a> { 1159 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1160 #[serde(borrow)] 1161 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 1162 #[serde(borrow)] 1163 pub uri: jacquard_common::types::string::AtUri<'a>, 1164 #[serde(borrow)] 1165 pub value: SubfsRecord<'a>, 1166} 1167 1168impl From<SubfsRecordGetRecordOutput<'_>> for SubfsRecord<'_> { 1169 fn from(output: SubfsRecordGetRecordOutput<'_>) -> Self { 1170 use jacquard_common::IntoStatic; 1171 output.value.into_static() 1172 } 1173} 1174 1175impl jacquard_common::types::collection::Collection for SubfsRecord<'_> { 1176 const NSID: &'static str = "place.wisp.subfs"; 1177 type Record = SubfsRecordRecord; 1178} 1179 1180/// Marker type for deserializing records from this collection. 1181#[derive(Debug, serde::Serialize, serde::Deserialize)] 1182pub struct SubfsRecordRecord; 1183impl jacquard_common::xrpc::XrpcResp for SubfsRecordRecord { 1184 const NSID: &'static str = "place.wisp.subfs"; 1185 const ENCODING: &'static str = "application/json"; 1186 type Output<'de> = SubfsRecordGetRecordOutput<'de>; 1187 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 1188} 1189 1190impl jacquard_common::types::collection::Collection for SubfsRecordRecord { 1191 const NSID: &'static str = "place.wisp.subfs"; 1192 type Record = SubfsRecordRecord; 1193} 1194 1195impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubfsRecord<'a> { 1196 fn nsid() -> &'static str { 1197 "place.wisp.subfs" 1198 } 1199 fn def_name() -> &'static str { 1200 "main" 1201 } 1202 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1203 lexicon_doc_place_wisp_subfs() 1204 } 1205 fn validate( 1206 &self, 1207 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1208 if let Some(ref value) = self.file_count { 1209 if *value > 1000i64 { 1210 return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { 1211 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 1212 "file_count", 1213 ), 1214 max: 1000i64, 1215 actual: *value, 1216 }); 1217 } 1218 } 1219 if let Some(ref value) = self.file_count { 1220 if *value < 0i64 { 1221 return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 1222 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 1223 "file_count", 1224 ), 1225 min: 0i64, 1226 actual: *value, 1227 }); 1228 } 1229 } 1230 Ok(()) 1231 } 1232} 1233 1234#[jacquard_derive::lexicon] 1235#[derive( 1236 serde::Serialize, 1237 serde::Deserialize, 1238 Debug, 1239 Clone, 1240 PartialEq, 1241 Eq, 1242 jacquard_derive::IntoStatic 1243)] 1244#[serde(rename_all = "camelCase")] 1245pub struct Subfs<'a> { 1246 /// AT-URI pointing to another place.wisp.subfs record for nested subtrees. When expanded, the referenced record's root entries are merged (flattened) into the parent directory, allowing recursive splitting of large directory structures. 1247 #[serde(borrow)] 1248 pub subject: jacquard_common::types::string::AtUri<'a>, 1249 #[serde(borrow)] 1250 pub r#type: jacquard_common::CowStr<'a>, 1251} 1252 1253pub mod subfs_state { 1254 1255 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1256 #[allow(unused)] 1257 use ::core::marker::PhantomData; 1258 mod sealed { 1259 pub trait Sealed {} 1260 } 1261 /// State trait tracking which required fields have been set 1262 pub trait State: sealed::Sealed { 1263 type Type; 1264 type Subject; 1265 } 1266 /// Empty state - all required fields are unset 1267 pub struct Empty(()); 1268 impl sealed::Sealed for Empty {} 1269 impl State for Empty { 1270 type Type = Unset; 1271 type Subject = Unset; 1272 } 1273 ///State transition - sets the `type` field to Set 1274 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 1275 impl<S: State> sealed::Sealed for SetType<S> {} 1276 impl<S: State> State for SetType<S> { 1277 type Type = Set<members::r#type>; 1278 type Subject = S::Subject; 1279 } 1280 ///State transition - sets the `subject` field to Set 1281 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 1282 impl<S: State> sealed::Sealed for SetSubject<S> {} 1283 impl<S: State> State for SetSubject<S> { 1284 type Type = S::Type; 1285 type Subject = Set<members::subject>; 1286 } 1287 /// Marker types for field names 1288 #[allow(non_camel_case_types)] 1289 pub mod members { 1290 ///Marker type for the `type` field 1291 pub struct r#type(()); 1292 ///Marker type for the `subject` field 1293 pub struct subject(()); 1294 } 1295} 1296 1297/// Builder for constructing an instance of this type 1298pub struct SubfsBuilder<'a, S: subfs_state::State> { 1299 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1300 __unsafe_private_named: ( 1301 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 1302 ::core::option::Option<jacquard_common::CowStr<'a>>, 1303 ), 1304 _phantom: ::core::marker::PhantomData<&'a ()>, 1305} 1306 1307impl<'a> Subfs<'a> { 1308 /// Create a new builder for this type 1309 pub fn new() -> SubfsBuilder<'a, subfs_state::Empty> { 1310 SubfsBuilder::new() 1311 } 1312} 1313 1314impl<'a> SubfsBuilder<'a, subfs_state::Empty> { 1315 /// Create a new builder with all fields unset 1316 pub fn new() -> Self { 1317 SubfsBuilder { 1318 _phantom_state: ::core::marker::PhantomData, 1319 __unsafe_private_named: (None, None), 1320 _phantom: ::core::marker::PhantomData, 1321 } 1322 } 1323} 1324 1325impl<'a, S> SubfsBuilder<'a, S> 1326where 1327 S: subfs_state::State, 1328 S::Subject: subfs_state::IsUnset, 1329{ 1330 /// Set the `subject` field (required) 1331 pub fn subject( 1332 mut self, 1333 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 1334 ) -> SubfsBuilder<'a, subfs_state::SetSubject<S>> { 1335 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1336 SubfsBuilder { 1337 _phantom_state: ::core::marker::PhantomData, 1338 __unsafe_private_named: self.__unsafe_private_named, 1339 _phantom: ::core::marker::PhantomData, 1340 } 1341 } 1342} 1343 1344impl<'a, S> SubfsBuilder<'a, S> 1345where 1346 S: subfs_state::State, 1347 S::Type: subfs_state::IsUnset, 1348{ 1349 /// Set the `type` field (required) 1350 pub fn r#type( 1351 mut self, 1352 value: impl Into<jacquard_common::CowStr<'a>>, 1353 ) -> SubfsBuilder<'a, subfs_state::SetType<S>> { 1354 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 1355 SubfsBuilder { 1356 _phantom_state: ::core::marker::PhantomData, 1357 __unsafe_private_named: self.__unsafe_private_named, 1358 _phantom: ::core::marker::PhantomData, 1359 } 1360 } 1361} 1362 1363impl<'a, S> SubfsBuilder<'a, S> 1364where 1365 S: subfs_state::State, 1366 S::Type: subfs_state::IsSet, 1367 S::Subject: subfs_state::IsSet, 1368{ 1369 /// Build the final struct 1370 pub fn build(self) -> Subfs<'a> { 1371 Subfs { 1372 subject: self.__unsafe_private_named.0.unwrap(), 1373 r#type: self.__unsafe_private_named.1.unwrap(), 1374 extra_data: Default::default(), 1375 } 1376 } 1377 /// Build the final struct with custom extra_data 1378 pub fn build_with_data( 1379 self, 1380 extra_data: std::collections::BTreeMap< 1381 jacquard_common::smol_str::SmolStr, 1382 jacquard_common::types::value::Data<'a>, 1383 >, 1384 ) -> Subfs<'a> { 1385 Subfs { 1386 subject: self.__unsafe_private_named.0.unwrap(), 1387 r#type: self.__unsafe_private_named.1.unwrap(), 1388 extra_data: Some(extra_data), 1389 } 1390 } 1391} 1392 1393impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subfs<'a> { 1394 fn nsid() -> &'static str { 1395 "place.wisp.subfs" 1396 } 1397 fn def_name() -> &'static str { 1398 "subfs" 1399 } 1400 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1401 lexicon_doc_place_wisp_subfs() 1402 } 1403 fn validate( 1404 &self, 1405 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1406 Ok(()) 1407 } 1408}