pub struct MessagesImageSource {
pub data: Option<String>,
pub media_type: Option<String>,
pub type_: MessagesImageSourceType,
pub url: Option<String>,
}Expand description
The source of an image content block. Can be a base64-encoded image or a URL.
JSON schema
{
"description": "The source of an image content block. Can be a base64-encoded\nimage or a URL.\n",
"type": "object",
"required": [
"type"
],
"properties": {
"data": {
"description": "Base64-encoded image data. Required when `type` is `base64`.\n",
"type": "string"
},
"media_type": {
"description": "The media type of the image (e.g. `image/jpeg`, `image/png`,\n`image/gif`, `image/webp`). Required when `type` is `base64`.\n",
"type": "string"
},
"type": {
"description": "The source type.",
"type": "string",
"enum": [
"base64",
"url"
]
},
"url": {
"description": "URL of the image. Required when `type` is `url`.\n",
"type": "string"
}
}
}Fields§
§data: Option<String>Base64-encoded image data. Required when type is base64.
media_type: Option<String>The media type of the image (e.g. image/jpeg, image/png,
image/gif, image/webp). Required when type is base64.
type_: MessagesImageSourceTypeThe source type.
url: Option<String>URL of the image. Required when type is url.
Trait Implementations§
Source§impl Clone for MessagesImageSource
impl Clone for MessagesImageSource
Source§fn clone(&self) -> MessagesImageSource
fn clone(&self) -> MessagesImageSource
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 MessagesImageSource
impl Debug for MessagesImageSource
Source§impl<'de> Deserialize<'de> for MessagesImageSource
impl<'de> Deserialize<'de> for MessagesImageSource
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
Auto Trait Implementations§
impl Freeze for MessagesImageSource
impl RefUnwindSafe for MessagesImageSource
impl Send for MessagesImageSource
impl Sync for MessagesImageSource
impl Unpin for MessagesImageSource
impl UnsafeUnpin for MessagesImageSource
impl UnwindSafe for MessagesImageSource
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