pub struct MediaInputContent {
pub source: InputContentSource,
pub metadata: Option<Value>,
}Expand description
An image, audio, video or document content part.
The four modalities share a shape, so they share a struct; which one it is
is carried by the InputContent variant.
Fields§
§source: InputContentSourceWhere the bytes are.
metadata: Option<Value>Producer-defined extras (dimensions, page counts, alt text, …).
Implementations§
Source§impl MediaInputContent
impl MediaInputContent
Sourcepub fn new(source: InputContentSource) -> Self
pub fn new(source: InputContentSource) -> Self
Builds a media part from a source, with no metadata.
Trait Implementations§
Source§impl Clone for MediaInputContent
impl Clone for MediaInputContent
Source§fn clone(&self) -> MediaInputContent
fn clone(&self) -> MediaInputContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for MediaInputContent
impl ComposeSchema for MediaInputContent
Source§impl Debug for MediaInputContent
impl Debug for MediaInputContent
Source§impl<'de> Deserialize<'de> for MediaInputContent
impl<'de> Deserialize<'de> for MediaInputContent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 JsonSchema for MediaInputContent
impl JsonSchema for MediaInputContent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for MediaInputContent
impl PartialEq for MediaInputContent
Source§fn eq(&self, other: &MediaInputContent) -> bool
fn eq(&self, other: &MediaInputContent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MediaInputContent
impl Serialize for MediaInputContent
impl StructuralPartialEq for MediaInputContent
Auto Trait Implementations§
impl Freeze for MediaInputContent
impl RefUnwindSafe for MediaInputContent
impl Send for MediaInputContent
impl Sync for MediaInputContent
impl Unpin for MediaInputContent
impl UnsafeUnpin for MediaInputContent
impl UnwindSafe for MediaInputContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more