pub struct OutputMedia {
pub url: String,
pub media_type: String,
}Expand description
Media/file output returned by the model.
Fields§
§url: StringOutput URL or provider resource URI.
media_type: StringMedia type reported by the provider.
Implementations§
Source§impl OutputMedia
impl OutputMedia
Sourcepub fn new(url: impl Into<String>, media_type: impl Into<String>) -> Self
pub fn new(url: impl Into<String>, media_type: impl Into<String>) -> Self
Build an output media wrapper.
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Return true when this media output looks like a document or generic file.
Sourcepub fn from_response_part(part: &ModelResponsePart) -> Option<Self>
pub fn from_response_part(part: &ModelResponsePart) -> Option<Self>
Build an output media wrapper from a canonical model response part.
Trait Implementations§
Source§impl Clone for OutputMedia
impl Clone for OutputMedia
Source§fn clone(&self) -> OutputMedia
fn clone(&self) -> OutputMedia
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 Debug for OutputMedia
impl Debug for OutputMedia
Source§impl<'de> Deserialize<'de> for OutputMedia
impl<'de> Deserialize<'de> for OutputMedia
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
impl Eq for OutputMedia
Source§impl PartialEq for OutputMedia
impl PartialEq for OutputMedia
Source§fn eq(&self, other: &OutputMedia) -> bool
fn eq(&self, other: &OutputMedia) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputMedia
impl Serialize for OutputMedia
impl StructuralPartialEq for OutputMedia
Auto Trait Implementations§
impl Freeze for OutputMedia
impl RefUnwindSafe for OutputMedia
impl Send for OutputMedia
impl Sync for OutputMedia
impl Unpin for OutputMedia
impl UnsafeUnpin for OutputMedia
impl UnwindSafe for OutputMedia
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