#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::Datetime;
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::sh_tangled::repo::blob;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LastCommit<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<blob::Signature<S>>,
pub hash: S,
pub message: S,
pub when: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Blob<S: BosStr = DefaultStr> {
pub path: S,
#[serde(default = "_default_raw")]
#[serde(skip_serializing_if = "Option::is_none")]
pub raw: Option<bool>,
pub r#ref: S,
pub repo: S,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BlobOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub encoding: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_binary: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_commit: Option<blob::LastCommit<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mime_type: Option<S>,
pub path: S,
pub r#ref: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub submodule: Option<blob::Submodule<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(
Serialize,
Deserialize,
Debug,
Clone,
PartialEq,
Eq,
thiserror::Error,
miette::Diagnostic
)]
#[serde(tag = "error", content = "message")]
pub enum BlobError {
#[serde(rename = "RepoNotFound")]
RepoNotFound(Option<SmolStr>),
#[serde(rename = "RefNotFound")]
RefNotFound(Option<SmolStr>),
#[serde(rename = "FileNotFound")]
FileNotFound(Option<SmolStr>),
#[serde(rename = "InvalidRequest")]
InvalidRequest(Option<SmolStr>),
#[serde(untagged)]
Other { error: SmolStr, message: Option<SmolStr> },
}
impl core::fmt::Display for BlobError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::RepoNotFound(msg) => {
write!(f, "RepoNotFound")?;
if let Some(msg) = msg {
write!(f, ": {}", msg)?;
}
Ok(())
}
Self::RefNotFound(msg) => {
write!(f, "RefNotFound")?;
if let Some(msg) = msg {
write!(f, ": {}", msg)?;
}
Ok(())
}
Self::FileNotFound(msg) => {
write!(f, "FileNotFound")?;
if let Some(msg) = msg {
write!(f, ": {}", msg)?;
}
Ok(())
}
Self::InvalidRequest(msg) => {
write!(f, "InvalidRequest")?;
if let Some(msg) = msg {
write!(f, ": {}", msg)?;
}
Ok(())
}
Self::Other { error, message } => {
write!(f, "{}", error)?;
if let Some(msg) = message {
write!(f, ": {}", msg)?;
}
Ok(())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Signature<S: BosStr = DefaultStr> {
pub email: S,
pub name: S,
pub when: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Submodule<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub branch: Option<S>,
pub name: S,
pub url: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for LastCommit<S> {
fn nsid() -> &'static str {
"sh.tangled.repo.blob"
}
fn def_name() -> &'static str {
"lastCommit"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_repo_blob()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub struct BlobResponse;
impl jacquard_common::xrpc::XrpcResp for BlobResponse {
const NSID: &'static str = "sh.tangled.repo.blob";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = BlobOutput<S>;
type Err = BlobError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for Blob<S> {
const NSID: &'static str = "sh.tangled.repo.blob";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = BlobResponse;
}
pub struct BlobRequest;
impl jacquard_common::xrpc::XrpcEndpoint for BlobRequest {
const PATH: &'static str = "/xrpc/sh.tangled.repo.blob";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = Blob<S>;
type Response = BlobResponse;
}
impl<S: BosStr> LexiconSchema for Signature<S> {
fn nsid() -> &'static str {
"sh.tangled.repo.blob"
}
fn def_name() -> &'static str {
"signature"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_repo_blob()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Submodule<S> {
fn nsid() -> &'static str {
"sh.tangled.repo.blob"
}
fn def_name() -> &'static str {
"submodule"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_repo_blob()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod last_commit_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Hash;
type Message;
type When;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Hash = Unset;
type Message = Unset;
type When = Unset;
}
pub struct SetHash<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHash<St> {}
impl<St: State> State for SetHash<St> {
type Hash = Set<members::hash>;
type Message = St::Message;
type When = St::When;
}
pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMessage<St> {}
impl<St: State> State for SetMessage<St> {
type Hash = St::Hash;
type Message = Set<members::message>;
type When = St::When;
}
pub struct SetWhen<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWhen<St> {}
impl<St: State> State for SetWhen<St> {
type Hash = St::Hash;
type Message = St::Message;
type When = Set<members::when>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct hash(());
pub struct message(());
pub struct when(());
}
}
pub struct LastCommitBuilder<S: BosStr, St: last_commit_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<blob::Signature<S>>, Option<S>, Option<S>, Option<Datetime>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> LastCommit<S> {
pub fn new() -> LastCommitBuilder<S, last_commit_state::Empty> {
LastCommitBuilder::new()
}
}
impl<S: BosStr> LastCommitBuilder<S, last_commit_state::Empty> {
pub fn new() -> Self {
LastCommitBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: last_commit_state::State> LastCommitBuilder<S, St> {
pub fn author(mut self, value: impl Into<Option<blob::Signature<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_author(mut self, value: Option<blob::Signature<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> LastCommitBuilder<S, St>
where
St: last_commit_state::State,
St::Hash: last_commit_state::IsUnset,
{
pub fn hash(
mut self,
value: impl Into<S>,
) -> LastCommitBuilder<S, last_commit_state::SetHash<St>> {
self._fields.1 = Option::Some(value.into());
LastCommitBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LastCommitBuilder<S, St>
where
St: last_commit_state::State,
St::Message: last_commit_state::IsUnset,
{
pub fn message(
mut self,
value: impl Into<S>,
) -> LastCommitBuilder<S, last_commit_state::SetMessage<St>> {
self._fields.2 = Option::Some(value.into());
LastCommitBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LastCommitBuilder<S, St>
where
St: last_commit_state::State,
St::When: last_commit_state::IsUnset,
{
pub fn when(
mut self,
value: impl Into<Datetime>,
) -> LastCommitBuilder<S, last_commit_state::SetWhen<St>> {
self._fields.3 = Option::Some(value.into());
LastCommitBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LastCommitBuilder<S, St>
where
St: last_commit_state::State,
St::Hash: last_commit_state::IsSet,
St::Message: last_commit_state::IsSet,
St::When: last_commit_state::IsSet,
{
pub fn build(self) -> LastCommit<S> {
LastCommit {
author: self._fields.0,
hash: self._fields.1.unwrap(),
message: self._fields.2.unwrap(),
when: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> LastCommit<S> {
LastCommit {
author: self._fields.0,
hash: self._fields.1.unwrap(),
message: self._fields.2.unwrap(),
when: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_tangled_repo_blob() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("sh.tangled.repo.blob"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("lastCommit"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("hash"), SmolStr::new_static("message"),
SmolStr::new_static("when")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#signature"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hash"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Commit hash")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("message"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Commit message")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("when"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Commit timestamp")),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::XrpcQuery(LexXrpcQuery {
parameters: Some(
LexXrpcQueryParameter::Params(LexXrpcParameters {
required: Some(
vec![
SmolStr::new_static("repo"), SmolStr::new_static("ref"),
SmolStr::new_static("path")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("path"),
LexXrpcParametersProperty::String(LexString {
description: Some(
CowStr::new_static("Path to the file within the repository"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("raw"),
LexXrpcParametersProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ref"),
LexXrpcParametersProperty::String(LexString {
description: Some(
CowStr::new_static(
"Git reference (branch, tag, or commit SHA)",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repo"),
LexXrpcParametersProperty::String(LexString {
description: Some(
CowStr::new_static(
"Repository identifier in format 'did:plc:.../repoName'",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signature"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("name"), SmolStr::new_static("email"),
SmolStr::new_static("when")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("email"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Author email")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Author name")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("when"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Author timestamp")),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("submodule"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("name"), SmolStr::new_static("url")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("branch"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Branch to track in the submodule"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Submodule name")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("url"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Submodule repository URL"),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
fn _default_raw() -> Option<bool> {
Some(false)
}
pub mod blob_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Repo;
type Ref;
type Path;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Repo = Unset;
type Ref = Unset;
type Path = Unset;
}
pub struct SetRepo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Repo = Set<members::repo>;
type Ref = St::Ref;
type Path = St::Path;
}
pub struct SetRef<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRef<St> {}
impl<St: State> State for SetRef<St> {
type Repo = St::Repo;
type Ref = Set<members::r#ref>;
type Path = St::Path;
}
pub struct SetPath<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPath<St> {}
impl<St: State> State for SetPath<St> {
type Repo = St::Repo;
type Ref = St::Ref;
type Path = Set<members::path>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct repo(());
pub struct r#ref(());
pub struct path(());
}
}
pub struct BlobBuilder<S: BosStr, St: blob_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<bool>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Blob<S> {
pub fn new() -> BlobBuilder<S, blob_state::Empty> {
BlobBuilder::new()
}
}
impl<S: BosStr> BlobBuilder<S, blob_state::Empty> {
pub fn new() -> Self {
BlobBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobBuilder<S, St>
where
St: blob_state::State,
St::Path: blob_state::IsUnset,
{
pub fn path(
mut self,
value: impl Into<S>,
) -> BlobBuilder<S, blob_state::SetPath<St>> {
self._fields.0 = Option::Some(value.into());
BlobBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: blob_state::State> BlobBuilder<S, St> {
pub fn raw(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_raw(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> BlobBuilder<S, St>
where
St: blob_state::State,
St::Ref: blob_state::IsUnset,
{
pub fn r#ref(
mut self,
value: impl Into<S>,
) -> BlobBuilder<S, blob_state::SetRef<St>> {
self._fields.2 = Option::Some(value.into());
BlobBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobBuilder<S, St>
where
St: blob_state::State,
St::Repo: blob_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<S>,
) -> BlobBuilder<S, blob_state::SetRepo<St>> {
self._fields.3 = Option::Some(value.into());
BlobBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobBuilder<S, St>
where
St: blob_state::State,
St::Repo: blob_state::IsSet,
St::Ref: blob_state::IsSet,
St::Path: blob_state::IsSet,
{
pub fn build(self) -> Blob<S> {
Blob {
path: self._fields.0.unwrap(),
raw: self._fields.1,
r#ref: self._fields.2.unwrap(),
repo: self._fields.3.unwrap(),
}
}
}
pub mod signature_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Name;
type Email;
type When;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type Email = Unset;
type When = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type Email = St::Email;
type When = St::When;
}
pub struct SetEmail<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEmail<St> {}
impl<St: State> State for SetEmail<St> {
type Name = St::Name;
type Email = Set<members::email>;
type When = St::When;
}
pub struct SetWhen<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWhen<St> {}
impl<St: State> State for SetWhen<St> {
type Name = St::Name;
type Email = St::Email;
type When = Set<members::when>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct email(());
pub struct when(());
}
}
pub struct SignatureBuilder<S: BosStr, St: signature_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<Datetime>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Signature<S> {
pub fn new() -> SignatureBuilder<S, signature_state::Empty> {
SignatureBuilder::new()
}
}
impl<S: BosStr> SignatureBuilder<S, signature_state::Empty> {
pub fn new() -> Self {
SignatureBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SignatureBuilder<S, St>
where
St: signature_state::State,
St::Email: signature_state::IsUnset,
{
pub fn email(
mut self,
value: impl Into<S>,
) -> SignatureBuilder<S, signature_state::SetEmail<St>> {
self._fields.0 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SignatureBuilder<S, St>
where
St: signature_state::State,
St::Name: signature_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> SignatureBuilder<S, signature_state::SetName<St>> {
self._fields.1 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SignatureBuilder<S, St>
where
St: signature_state::State,
St::When: signature_state::IsUnset,
{
pub fn when(
mut self,
value: impl Into<Datetime>,
) -> SignatureBuilder<S, signature_state::SetWhen<St>> {
self._fields.2 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SignatureBuilder<S, St>
where
St: signature_state::State,
St::Name: signature_state::IsSet,
St::Email: signature_state::IsSet,
St::When: signature_state::IsSet,
{
pub fn build(self) -> Signature<S> {
Signature {
email: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
when: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> Signature<S> {
Signature {
email: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
when: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}