#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::blob::BlobRef;
use jacquard_common::types::string::UriValue;
use jacquard_derive::{IntoStatic, lexicon};
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::app_bsky::embed::AspectRatio;
use crate::art_cllctv::embed::Tombstone;
use crate::art_cllctv::embed::images;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Image<'a> {
#[serde(borrow)]
pub alt: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub aspect_ratio: Option<AspectRatio<'a>>,
#[serde(borrow)]
pub image: BlobRef<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub image_hash: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tombstone: Option<Tombstone<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Images<'a> {
#[serde(borrow)]
pub images: Vec<images::Image<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct View<'a> {
#[serde(borrow)]
pub images: Vec<images::ViewImage<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ViewImage<'a> {
#[serde(borrow)]
pub alt: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub aspect_ratio: Option<AspectRatio<'a>>,
#[serde(borrow)]
pub fullsize: UriValue<'a>,
#[serde(borrow)]
pub thumb: UriValue<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tombstone: Option<Tombstone<'a>>,
}
impl<'a> LexiconSchema for Image<'a> {
fn nsid() -> &'static str {
"art.cllctv.embed.images"
}
fn def_name() -> &'static str {
"image"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_art_cllctv_embed_images()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.image;
{
let size = value.blob().size;
if size > 50000000usize {
return Err(ConstraintError::BlobTooLarge {
path: ValidationPath::from_field("image"),
max: 50000000usize,
actual: size,
});
}
}
}
{
let value = &self.image;
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["image/*"];
let matched = accepted
.iter()
.any(|pattern| {
if *pattern == "*/*" {
true
} else if pattern.ends_with("/*") {
let prefix = &pattern[..pattern.len() - 2];
mime.starts_with(prefix)
&& mime.as_bytes().get(prefix.len()) == Some(&b'/')
} else {
mime == *pattern
}
});
if !matched {
return Err(ConstraintError::BlobMimeTypeNotAccepted {
path: ValidationPath::from_field("image"),
accepted: vec!["image/*".to_string()],
actual: mime.to_string(),
});
}
}
}
if let Some(ref value) = self.image_hash {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("image_hash"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.image_hash {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("image_hash"),
max: 64usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<'a> LexiconSchema for Images<'a> {
fn nsid() -> &'static str {
"art.cllctv.embed.images"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_art_cllctv_embed_images()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.images;
#[allow(unused_comparisons)]
if value.len() > 9usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("images"),
max: 9usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for View<'a> {
fn nsid() -> &'static str {
"art.cllctv.embed.images"
}
fn def_name() -> &'static str {
"view"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_art_cllctv_embed_images()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.images;
#[allow(unused_comparisons)]
if value.len() > 9usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("images"),
max: 9usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for ViewImage<'a> {
fn nsid() -> &'static str {
"art.cllctv.embed.images"
}
fn def_name() -> &'static str {
"viewImage"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_art_cllctv_embed_images()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod image_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 Image;
type Alt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Image = Unset;
type Alt = Unset;
}
pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetImage<S> {}
impl<S: State> State for SetImage<S> {
type Image = Set<members::image>;
type Alt = S::Alt;
}
pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAlt<S> {}
impl<S: State> State for SetAlt<S> {
type Image = S::Image;
type Alt = Set<members::alt>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct image(());
pub struct alt(());
}
}
pub struct ImageBuilder<'a, S: image_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<AspectRatio<'a>>,
Option<BlobRef<'a>>,
Option<CowStr<'a>>,
Option<Tombstone<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Image<'a> {
pub fn new() -> ImageBuilder<'a, image_state::Empty> {
ImageBuilder::new()
}
}
impl<'a> ImageBuilder<'a, image_state::Empty> {
pub fn new() -> Self {
ImageBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageBuilder<'a, S>
where
S: image_state::State,
S::Alt: image_state::IsUnset,
{
pub fn alt(
mut self,
value: impl Into<CowStr<'a>>,
) -> ImageBuilder<'a, image_state::SetAlt<S>> {
self._fields.0 = Option::Some(value.into());
ImageBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: image_state::State> ImageBuilder<'a, S> {
pub fn aspect_ratio(mut self, value: impl Into<Option<AspectRatio<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_aspect_ratio(mut self, value: Option<AspectRatio<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> ImageBuilder<'a, S>
where
S: image_state::State,
S::Image: image_state::IsUnset,
{
pub fn image(
mut self,
value: impl Into<BlobRef<'a>>,
) -> ImageBuilder<'a, image_state::SetImage<S>> {
self._fields.2 = Option::Some(value.into());
ImageBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: image_state::State> ImageBuilder<'a, S> {
pub fn image_hash(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_image_hash(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S: image_state::State> ImageBuilder<'a, S> {
pub fn tombstone(mut self, value: impl Into<Option<Tombstone<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_tombstone(mut self, value: Option<Tombstone<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> ImageBuilder<'a, S>
where
S: image_state::State,
S::Image: image_state::IsSet,
S::Alt: image_state::IsSet,
{
pub fn build(self) -> Image<'a> {
Image {
alt: self._fields.0.unwrap(),
aspect_ratio: self._fields.1,
image: self._fields.2.unwrap(),
image_hash: self._fields.3,
tombstone: self._fields.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Image<'a> {
Image {
alt: self._fields.0.unwrap(),
aspect_ratio: self._fields.1,
image: self._fields.2.unwrap(),
image_hash: self._fields.3,
tombstone: self._fields.4,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_art_cllctv_embed_images() -> 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("art.cllctv.embed.images"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("image"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("image"), SmolStr::new_static("alt")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Alt text description of the image, for accessibility.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("aspectRatio"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.embed.defs#aspectRatio",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("image"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("imageHash"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tombstone"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"art.cllctv.embed.defs#tombstone",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("images")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("images"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#image"),
..Default::default()
}),
max_length: Some(9usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("view"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("images")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("images"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#viewImage"),
..Default::default()
}),
max_length: Some(9usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewImage"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("thumb"),
SmolStr::new_static("fullsize"), SmolStr::new_static("alt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Alt text description of the image, for accessibility.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("aspectRatio"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.embed.defs#aspectRatio",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("fullsize"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("thumb"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tombstone"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"art.cllctv.embed.defs#tombstone",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod images_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 Images;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Images = Unset;
}
pub struct SetImages<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetImages<S> {}
impl<S: State> State for SetImages<S> {
type Images = Set<members::images>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct images(());
}
}
pub struct ImagesBuilder<'a, S: images_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<images::Image<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Images<'a> {
pub fn new() -> ImagesBuilder<'a, images_state::Empty> {
ImagesBuilder::new()
}
}
impl<'a> ImagesBuilder<'a, images_state::Empty> {
pub fn new() -> Self {
ImagesBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImagesBuilder<'a, S>
where
S: images_state::State,
S::Images: images_state::IsUnset,
{
pub fn images(
mut self,
value: impl Into<Vec<images::Image<'a>>>,
) -> ImagesBuilder<'a, images_state::SetImages<S>> {
self._fields.0 = Option::Some(value.into());
ImagesBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImagesBuilder<'a, S>
where
S: images_state::State,
S::Images: images_state::IsSet,
{
pub fn build(self) -> Images<'a> {
Images {
images: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Images<'a> {
Images {
images: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod view_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Images;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Images = Unset;
}
pub struct SetImages<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetImages<S> {}
impl<S: State> State for SetImages<S> {
type Images = Set<members::images>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct images(());
}
}
pub struct ViewBuilder<'a, S: view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<images::ViewImage<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> View<'a> {
pub fn new() -> ViewBuilder<'a, view_state::Empty> {
ViewBuilder::new()
}
}
impl<'a> ViewBuilder<'a, view_state::Empty> {
pub fn new() -> Self {
ViewBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ViewBuilder<'a, S>
where
S: view_state::State,
S::Images: view_state::IsUnset,
{
pub fn images(
mut self,
value: impl Into<Vec<images::ViewImage<'a>>>,
) -> ViewBuilder<'a, view_state::SetImages<S>> {
self._fields.0 = Option::Some(value.into());
ViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ViewBuilder<'a, S>
where
S: view_state::State,
S::Images: view_state::IsSet,
{
pub fn build(self) -> View<'a> {
View {
images: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> View<'a> {
View {
images: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod view_image_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 Fullsize;
type Thumb;
type Alt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Fullsize = Unset;
type Thumb = Unset;
type Alt = Unset;
}
pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetFullsize<S> {}
impl<S: State> State for SetFullsize<S> {
type Fullsize = Set<members::fullsize>;
type Thumb = S::Thumb;
type Alt = S::Alt;
}
pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetThumb<S> {}
impl<S: State> State for SetThumb<S> {
type Fullsize = S::Fullsize;
type Thumb = Set<members::thumb>;
type Alt = S::Alt;
}
pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAlt<S> {}
impl<S: State> State for SetAlt<S> {
type Fullsize = S::Fullsize;
type Thumb = S::Thumb;
type Alt = Set<members::alt>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct fullsize(());
pub struct thumb(());
pub struct alt(());
}
}
pub struct ViewImageBuilder<'a, S: view_image_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<AspectRatio<'a>>,
Option<UriValue<'a>>,
Option<UriValue<'a>>,
Option<Tombstone<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ViewImage<'a> {
pub fn new() -> ViewImageBuilder<'a, view_image_state::Empty> {
ViewImageBuilder::new()
}
}
impl<'a> ViewImageBuilder<'a, view_image_state::Empty> {
pub fn new() -> Self {
ViewImageBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ViewImageBuilder<'a, S>
where
S: view_image_state::State,
S::Alt: view_image_state::IsUnset,
{
pub fn alt(
mut self,
value: impl Into<CowStr<'a>>,
) -> ViewImageBuilder<'a, view_image_state::SetAlt<S>> {
self._fields.0 = Option::Some(value.into());
ViewImageBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> {
pub fn aspect_ratio(mut self, value: impl Into<Option<AspectRatio<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_aspect_ratio(mut self, value: Option<AspectRatio<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> ViewImageBuilder<'a, S>
where
S: view_image_state::State,
S::Fullsize: view_image_state::IsUnset,
{
pub fn fullsize(
mut self,
value: impl Into<UriValue<'a>>,
) -> ViewImageBuilder<'a, view_image_state::SetFullsize<S>> {
self._fields.2 = Option::Some(value.into());
ViewImageBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ViewImageBuilder<'a, S>
where
S: view_image_state::State,
S::Thumb: view_image_state::IsUnset,
{
pub fn thumb(
mut self,
value: impl Into<UriValue<'a>>,
) -> ViewImageBuilder<'a, view_image_state::SetThumb<S>> {
self._fields.3 = Option::Some(value.into());
ViewImageBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> {
pub fn tombstone(mut self, value: impl Into<Option<Tombstone<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_tombstone(mut self, value: Option<Tombstone<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> ViewImageBuilder<'a, S>
where
S: view_image_state::State,
S::Fullsize: view_image_state::IsSet,
S::Thumb: view_image_state::IsSet,
S::Alt: view_image_state::IsSet,
{
pub fn build(self) -> ViewImage<'a> {
ViewImage {
alt: self._fields.0.unwrap(),
aspect_ratio: self._fields.1,
fullsize: self._fields.2.unwrap(),
thumb: self._fields.3.unwrap(),
tombstone: self._fields.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ViewImage<'a> {
ViewImage {
alt: self._fields.0.unwrap(),
aspect_ratio: self._fields.1,
fullsize: self._fields.2.unwrap(),
thumb: self._fields.3.unwrap(),
tombstone: self._fields.4,
extra_data: Some(extra_data),
}
}
}