ArtifactMetadata

Enum ArtifactMetadata 

Source
pub enum ArtifactMetadata {
    Audio {
        duration_secs: f32,
        format: String,
        transcript_id: Option<ArtifactId>,
    },
    Image {
        width: u32,
        height: u32,
        format: String,
        alt_text: Option<String>,
    },
    Video {
        duration_secs: f32,
        format: String,
        thumbnail_id: Option<ArtifactId>,
    },
    Transcript {
        source_artifact_id: ArtifactId,
        confidence: f32,
        language: Option<String>,
    },
    Screenshot {
        captured_at: Timestamp,
        context: String,
        width: Option<u32>,
        height: Option<u32>,
    },
}
Expand description

Typed metadata for multimodal artifacts. This enum provides strongly-typed metadata schemas for different artifact types. It can be serialized to/from the generic metadata JSONB field.

Variants§

§

Audio

Metadata for audio artifacts

Fields

§duration_secs: f32

Duration in seconds

§format: String

Audio format (e.g., “mp3”, “wav”, “ogg”)

§transcript_id: Option<ArtifactId>

Optional linked transcript artifact

§

Image

Metadata for image artifacts

Fields

§width: u32

Image width in pixels

§height: u32

Image height in pixels

§format: String

Image format (e.g., “png”, “jpeg”, “webp”)

§alt_text: Option<String>

Alt text description

§

Video

Metadata for video artifacts

Fields

§duration_secs: f32

Duration in seconds

§format: String

Video format (e.g., “mp4”, “webm”)

§thumbnail_id: Option<ArtifactId>

Optional linked thumbnail artifact

§

Transcript

Metadata for transcript artifacts (audio→text)

Fields

§source_artifact_id: ArtifactId

Source audio artifact that was transcribed

§confidence: f32

Transcription confidence score (0.0-1.0)

§language: Option<String>

Language of the transcript (ISO 639-1 code)

§

Screenshot

Metadata for screenshot artifacts

Fields

§captured_at: Timestamp

When the screenshot was captured

§context: String

Context description (what was being viewed)

§width: Option<u32>

Image width in pixels

§height: Option<u32>

Image height in pixels

Implementations§

Source§

impl ArtifactMetadata

Source

pub fn to_json(&self) -> Value

Convert to a generic JSON value for storage in the metadata field.

Source

pub fn from_json(value: &Value) -> Option<Self>

Try to parse from a generic JSON value.

Trait Implementations§

Source§

impl Clone for ArtifactMetadata

Source§

fn clone(&self) -> ArtifactMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for ArtifactMetadata

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for ArtifactMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ArtifactMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ArtifactMetadata

Source§

fn eq(&self, other: &ArtifactMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ArtifactMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for ArtifactMetadata

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more
Source§

impl StructuralPartialEq for ArtifactMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,