#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Audio<'a> {
pub channels: i64,
#[serde(borrow)]
pub codec: jacquard_common::CowStr<'a>,
pub rate: i64,
}
pub mod audio_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 Codec;
type Rate;
type Channels;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Codec = Unset;
type Rate = Unset;
type Channels = Unset;
}
pub struct SetCodec<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCodec<S> {}
impl<S: State> State for SetCodec<S> {
type Codec = Set<members::codec>;
type Rate = S::Rate;
type Channels = S::Channels;
}
pub struct SetRate<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRate<S> {}
impl<S: State> State for SetRate<S> {
type Codec = S::Codec;
type Rate = Set<members::rate>;
type Channels = S::Channels;
}
pub struct SetChannels<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetChannels<S> {}
impl<S: State> State for SetChannels<S> {
type Codec = S::Codec;
type Rate = S::Rate;
type Channels = Set<members::channels>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct codec(());
pub struct rate(());
pub struct channels(());
}
}
pub struct AudioBuilder<'a, S: audio_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Audio<'a> {
pub fn new() -> AudioBuilder<'a, audio_state::Empty> {
AudioBuilder::new()
}
}
impl<'a> AudioBuilder<'a, audio_state::Empty> {
pub fn new() -> Self {
AudioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AudioBuilder<'a, S>
where
S: audio_state::State,
S::Channels: audio_state::IsUnset,
{
pub fn channels(
mut self,
value: impl Into<i64>,
) -> AudioBuilder<'a, audio_state::SetChannels<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
AudioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AudioBuilder<'a, S>
where
S: audio_state::State,
S::Codec: audio_state::IsUnset,
{
pub fn codec(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> AudioBuilder<'a, audio_state::SetCodec<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
AudioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AudioBuilder<'a, S>
where
S: audio_state::State,
S::Rate: audio_state::IsUnset,
{
pub fn rate(
mut self,
value: impl Into<i64>,
) -> AudioBuilder<'a, audio_state::SetRate<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
AudioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AudioBuilder<'a, S>
where
S: audio_state::State,
S::Codec: audio_state::IsSet,
S::Rate: audio_state::IsSet,
S::Channels: audio_state::IsSet,
{
pub fn build(self) -> Audio<'a> {
Audio {
channels: self.__unsafe_private_named.0.unwrap(),
codec: self.__unsafe_private_named.1.unwrap(),
rate: self.__unsafe_private_named.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Audio<'a> {
Audio {
channels: self.__unsafe_private_named.0.unwrap(),
codec: self.__unsafe_private_named.1.unwrap(),
rate: self.__unsafe_private_named.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_place_stream_segment() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("place.stream.segment"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("audio"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("codec"),
::jacquard_common::deps::smol_str::SmolStr::new_static("rate"),
::jacquard_common::deps::smol_str::SmolStr::new_static("channels")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"channels",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"codec",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"rate",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("framerate"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("num"),
::jacquard_common::deps::smol_str::SmolStr::new_static("den")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"den",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"num",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static(
"Media file representing a segment of a livestream",
),
),
key: Some(::jacquard_common::CowStr::new_static("tid")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("id"),
::jacquard_common::deps::smol_str::SmolStr::new_static("signingKey"),
::jacquard_common::deps::smol_str::SmolStr::new_static("startTime"),
::jacquard_common::deps::smol_str::SmolStr::new_static("creator")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"audio",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#audio"),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"contentRights",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"place.stream.metadata.contentRights",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"contentWarnings",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"place.stream.metadata.contentWarnings",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"creator",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Did,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"distributionPolicy",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"place.stream.metadata.distributionPolicy",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"duration",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"id",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Unique identifier for the segment",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"signingKey",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The DID of the signing key used for this segment",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"size",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"startTime",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"When this segment started",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"video",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#video"),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("segmentView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("video"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("codec"),
::jacquard_common::deps::smol_str::SmolStr::new_static("width"),
::jacquard_common::deps::smol_str::SmolStr::new_static("height")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"bframes",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"codec",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"framerate",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#framerate"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"height",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"width",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Audio<'a> {
fn nsid() -> &'static str {
"place.stream.segment"
}
fn def_name() -> &'static str {
"audio"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_segment()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Framerate<'a> {
pub den: i64,
pub num: i64,
}
pub mod framerate_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 Num;
type Den;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Num = Unset;
type Den = Unset;
}
pub struct SetNum<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNum<S> {}
impl<S: State> State for SetNum<S> {
type Num = Set<members::num>;
type Den = S::Den;
}
pub struct SetDen<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDen<S> {}
impl<S: State> State for SetDen<S> {
type Num = S::Num;
type Den = Set<members::den>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct num(());
pub struct den(());
}
}
pub struct FramerateBuilder<'a, S: framerate_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<i64>, ::core::option::Option<i64>),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Framerate<'a> {
pub fn new() -> FramerateBuilder<'a, framerate_state::Empty> {
FramerateBuilder::new()
}
}
impl<'a> FramerateBuilder<'a, framerate_state::Empty> {
pub fn new() -> Self {
FramerateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FramerateBuilder<'a, S>
where
S: framerate_state::State,
S::Den: framerate_state::IsUnset,
{
pub fn den(
mut self,
value: impl Into<i64>,
) -> FramerateBuilder<'a, framerate_state::SetDen<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
FramerateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FramerateBuilder<'a, S>
where
S: framerate_state::State,
S::Num: framerate_state::IsUnset,
{
pub fn num(
mut self,
value: impl Into<i64>,
) -> FramerateBuilder<'a, framerate_state::SetNum<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
FramerateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> FramerateBuilder<'a, S>
where
S: framerate_state::State,
S::Num: framerate_state::IsSet,
S::Den: framerate_state::IsSet,
{
pub fn build(self) -> Framerate<'a> {
Framerate {
den: self.__unsafe_private_named.0.unwrap(),
num: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Framerate<'a> {
Framerate {
den: self.__unsafe_private_named.0.unwrap(),
num: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Framerate<'a> {
fn nsid() -> &'static str {
"place.stream.segment"
}
fn def_name() -> &'static str {
"framerate"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_segment()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Segment<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub audio: std::option::Option<Vec<crate::place_stream::segment::Audio<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub content_rights: std::option::Option<
crate::place_stream::metadata::content_rights::ContentRights<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub content_warnings: std::option::Option<
crate::place_stream::metadata::content_warnings::ContentWarnings<'a>,
>,
#[serde(borrow)]
pub creator: jacquard_common::types::string::Did<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub distribution_policy: std::option::Option<
crate::place_stream::metadata::distribution_policy::DistributionPolicy<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub duration: std::option::Option<i64>,
#[serde(borrow)]
pub id: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub signing_key: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub size: std::option::Option<i64>,
pub start_time: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub video: std::option::Option<Vec<crate::place_stream::segment::Video<'a>>>,
}
pub mod segment_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 Id;
type StartTime;
type Creator;
type SigningKey;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type StartTime = Unset;
type Creator = Unset;
type SigningKey = Unset;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Id = Set<members::id>;
type StartTime = S::StartTime;
type Creator = S::Creator;
type SigningKey = S::SigningKey;
}
pub struct SetStartTime<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStartTime<S> {}
impl<S: State> State for SetStartTime<S> {
type Id = S::Id;
type StartTime = Set<members::start_time>;
type Creator = S::Creator;
type SigningKey = S::SigningKey;
}
pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreator<S> {}
impl<S: State> State for SetCreator<S> {
type Id = S::Id;
type StartTime = S::StartTime;
type Creator = Set<members::creator>;
type SigningKey = S::SigningKey;
}
pub struct SetSigningKey<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSigningKey<S> {}
impl<S: State> State for SetSigningKey<S> {
type Id = S::Id;
type StartTime = S::StartTime;
type Creator = S::Creator;
type SigningKey = Set<members::signing_key>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct start_time(());
pub struct creator(());
pub struct signing_key(());
}
}
pub struct SegmentBuilder<'a, S: segment_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::place_stream::segment::Audio<'a>>>,
::core::option::Option<
crate::place_stream::metadata::content_rights::ContentRights<'a>,
>,
::core::option::Option<
crate::place_stream::metadata::content_warnings::ContentWarnings<'a>,
>,
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<
crate::place_stream::metadata::distribution_policy::DistributionPolicy<'a>,
>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<Vec<crate::place_stream::segment::Video<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Segment<'a> {
pub fn new() -> SegmentBuilder<'a, segment_state::Empty> {
SegmentBuilder::new()
}
}
impl<'a> SegmentBuilder<'a, segment_state::Empty> {
pub fn new() -> Self {
SegmentBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn audio(
mut self,
value: impl Into<Option<Vec<crate::place_stream::segment::Audio<'a>>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_audio(
mut self,
value: Option<Vec<crate::place_stream::segment::Audio<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn content_rights(
mut self,
value: impl Into<
Option<crate::place_stream::metadata::content_rights::ContentRights<'a>>,
>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_content_rights(
mut self,
value: Option<crate::place_stream::metadata::content_rights::ContentRights<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn content_warnings(
mut self,
value: impl Into<
Option<crate::place_stream::metadata::content_warnings::ContentWarnings<'a>>,
>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_content_warnings(
mut self,
value: Option<
crate::place_stream::metadata::content_warnings::ContentWarnings<'a>,
>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> SegmentBuilder<'a, S>
where
S: segment_state::State,
S::Creator: segment_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> SegmentBuilder<'a, segment_state::SetCreator<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
SegmentBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn distribution_policy(
mut self,
value: impl Into<
Option<
crate::place_stream::metadata::distribution_policy::DistributionPolicy<
'a,
>,
>,
>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_distribution_policy(
mut self,
value: Option<
crate::place_stream::metadata::distribution_policy::DistributionPolicy<'a>,
>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn duration(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_duration(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S> SegmentBuilder<'a, S>
where
S: segment_state::State,
S::Id: segment_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> SegmentBuilder<'a, segment_state::SetId<S>> {
self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
SegmentBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> SegmentBuilder<'a, S>
where
S: segment_state::State,
S::SigningKey: segment_state::IsUnset,
{
pub fn signing_key(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> SegmentBuilder<'a, segment_state::SetSigningKey<S>> {
self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
SegmentBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn size(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_size(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S> SegmentBuilder<'a, S>
where
S: segment_state::State,
S::StartTime: segment_state::IsUnset,
{
pub fn start_time(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> SegmentBuilder<'a, segment_state::SetStartTime<S>> {
self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
SegmentBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: segment_state::State> SegmentBuilder<'a, S> {
pub fn video(
mut self,
value: impl Into<Option<Vec<crate::place_stream::segment::Video<'a>>>>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_video(
mut self,
value: Option<Vec<crate::place_stream::segment::Video<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S> SegmentBuilder<'a, S>
where
S: segment_state::State,
S::Id: segment_state::IsSet,
S::StartTime: segment_state::IsSet,
S::Creator: segment_state::IsSet,
S::SigningKey: segment_state::IsSet,
{
pub fn build(self) -> Segment<'a> {
Segment {
audio: self.__unsafe_private_named.0,
content_rights: self.__unsafe_private_named.1,
content_warnings: self.__unsafe_private_named.2,
creator: self.__unsafe_private_named.3.unwrap(),
distribution_policy: self.__unsafe_private_named.4,
duration: self.__unsafe_private_named.5,
id: self.__unsafe_private_named.6.unwrap(),
signing_key: self.__unsafe_private_named.7.unwrap(),
size: self.__unsafe_private_named.8,
start_time: self.__unsafe_private_named.9.unwrap(),
video: self.__unsafe_private_named.10,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Segment<'a> {
Segment {
audio: self.__unsafe_private_named.0,
content_rights: self.__unsafe_private_named.1,
content_warnings: self.__unsafe_private_named.2,
creator: self.__unsafe_private_named.3.unwrap(),
distribution_policy: self.__unsafe_private_named.4,
duration: self.__unsafe_private_named.5,
id: self.__unsafe_private_named.6.unwrap(),
signing_key: self.__unsafe_private_named.7.unwrap(),
size: self.__unsafe_private_named.8,
start_time: self.__unsafe_private_named.9.unwrap(),
video: self.__unsafe_private_named.10,
extra_data: Some(extra_data),
}
}
}
impl<'a> Segment<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, SegmentRecord>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct SegmentGetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: Segment<'a>,
}
impl From<SegmentGetRecordOutput<'_>> for Segment<'_> {
fn from(output: SegmentGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for Segment<'_> {
const NSID: &'static str = "place.stream.segment";
type Record = SegmentRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct SegmentRecord;
impl jacquard_common::xrpc::XrpcResp for SegmentRecord {
const NSID: &'static str = "place.stream.segment";
const ENCODING: &'static str = "application/json";
type Output<'de> = SegmentGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for SegmentRecord {
const NSID: &'static str = "place.stream.segment";
type Record = SegmentRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Segment<'a> {
fn nsid() -> &'static str {
"place.stream.segment"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_segment()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct SegmentView<'a> {
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
}
pub mod segment_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 Record;
type Cid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Record = Unset;
type Cid = Unset;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Record = Set<members::record>;
type Cid = S::Cid;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Record = S::Record;
type Cid = Set<members::cid>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct record(());
pub struct cid(());
}
}
pub struct SegmentViewBuilder<'a, S: segment_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> SegmentView<'a> {
pub fn new() -> SegmentViewBuilder<'a, segment_view_state::Empty> {
SegmentViewBuilder::new()
}
}
impl<'a> SegmentViewBuilder<'a, segment_view_state::Empty> {
pub fn new() -> Self {
SegmentViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> SegmentViewBuilder<'a, S>
where
S: segment_view_state::State,
S::Cid: segment_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> SegmentViewBuilder<'a, segment_view_state::SetCid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
SegmentViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> SegmentViewBuilder<'a, S>
where
S: segment_view_state::State,
S::Record: segment_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> SegmentViewBuilder<'a, segment_view_state::SetRecord<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
SegmentViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> SegmentViewBuilder<'a, S>
where
S: segment_view_state::State,
S::Record: segment_view_state::IsSet,
S::Cid: segment_view_state::IsSet,
{
pub fn build(self) -> SegmentView<'a> {
SegmentView {
cid: self.__unsafe_private_named.0.unwrap(),
record: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SegmentView<'a> {
SegmentView {
cid: self.__unsafe_private_named.0.unwrap(),
record: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SegmentView<'a> {
fn nsid() -> &'static str {
"place.stream.segment"
}
fn def_name() -> &'static str {
"segmentView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_segment()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Video<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub bframes: std::option::Option<bool>,
#[serde(borrow)]
pub codec: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub framerate: std::option::Option<crate::place_stream::segment::Framerate<'a>>,
pub height: i64,
pub width: i64,
}
pub mod video_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 Width;
type Codec;
type Height;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Width = Unset;
type Codec = Unset;
type Height = Unset;
}
pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetWidth<S> {}
impl<S: State> State for SetWidth<S> {
type Width = Set<members::width>;
type Codec = S::Codec;
type Height = S::Height;
}
pub struct SetCodec<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCodec<S> {}
impl<S: State> State for SetCodec<S> {
type Width = S::Width;
type Codec = Set<members::codec>;
type Height = S::Height;
}
pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHeight<S> {}
impl<S: State> State for SetHeight<S> {
type Width = S::Width;
type Codec = S::Codec;
type Height = Set<members::height>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct width(());
pub struct codec(());
pub struct height(());
}
}
pub struct VideoBuilder<'a, S: video_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<bool>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<crate::place_stream::segment::Framerate<'a>>,
::core::option::Option<i64>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Video<'a> {
pub fn new() -> VideoBuilder<'a, video_state::Empty> {
VideoBuilder::new()
}
}
impl<'a> VideoBuilder<'a, video_state::Empty> {
pub fn new() -> Self {
VideoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: video_state::State> VideoBuilder<'a, S> {
pub fn bframes(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_bframes(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> VideoBuilder<'a, S>
where
S: video_state::State,
S::Codec: video_state::IsUnset,
{
pub fn codec(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> VideoBuilder<'a, video_state::SetCodec<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
VideoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: video_state::State> VideoBuilder<'a, S> {
pub fn framerate(
mut self,
value: impl Into<Option<crate::place_stream::segment::Framerate<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_framerate(
mut self,
value: Option<crate::place_stream::segment::Framerate<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> VideoBuilder<'a, S>
where
S: video_state::State,
S::Height: video_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> VideoBuilder<'a, video_state::SetHeight<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
VideoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> VideoBuilder<'a, S>
where
S: video_state::State,
S::Width: video_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> VideoBuilder<'a, video_state::SetWidth<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
VideoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> VideoBuilder<'a, S>
where
S: video_state::State,
S::Width: video_state::IsSet,
S::Codec: video_state::IsSet,
S::Height: video_state::IsSet,
{
pub fn build(self) -> Video<'a> {
Video {
bframes: self.__unsafe_private_named.0,
codec: self.__unsafe_private_named.1.unwrap(),
framerate: self.__unsafe_private_named.2,
height: self.__unsafe_private_named.3.unwrap(),
width: self.__unsafe_private_named.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Video<'a> {
Video {
bframes: self.__unsafe_private_named.0,
codec: self.__unsafe_private_named.1.unwrap(),
framerate: self.__unsafe_private_named.2,
height: self.__unsafe_private_named.3.unwrap(),
width: self.__unsafe_private_named.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Video<'a> {
fn nsid() -> &'static str {
"place.stream.segment"
}
fn def_name() -> &'static str {
"video"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_segment()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}