#[non_exhaustive]pub enum ImageInput {
DataUri(String),
Url(String),
Base64 {
data: String,
mime_type: String,
},
}Expand description
Provider-neutral image input for vision embedding models.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DataUri(String)
A complete data URI (data:image/png;base64,<data>). Sent inline.
Url(String)
A provider-fetchable image URL (support depends on the backend — DashScope fetches public URLs; the Cohere API requires inline bytes).
Base64
Raw base64-encoded image bytes with an explicit MIME type
(e.g. image/png).
Implementations§
Source§impl ImageInput
impl ImageInput
Sourcepub fn from_url(url: impl Into<String>) -> ImageInput
pub fn from_url(url: impl Into<String>) -> ImageInput
Creates an image input from a provider-fetchable URL.
Sourcepub fn from_data_uri(uri: impl Into<String>) -> ImageInput
pub fn from_data_uri(uri: impl Into<String>) -> ImageInput
Creates an image input from a complete data URI.
Sourcepub fn from_base64(
data: impl Into<String>,
mime_type: impl Into<String>,
) -> ImageInput
pub fn from_base64( data: impl Into<String>, mime_type: impl Into<String>, ) -> ImageInput
Creates an image input from raw base64 bytes and a MIME type.
Trait Implementations§
Source§impl Clone for ImageInput
impl Clone for ImageInput
Source§fn clone(&self) -> ImageInput
fn clone(&self) -> ImageInput
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 ImageInput
impl Debug for ImageInput
Source§impl<'de> Deserialize<'de> for ImageInput
impl<'de> Deserialize<'de> for ImageInput
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ImageInput
Source§impl PartialEq for ImageInput
impl PartialEq for ImageInput
Source§impl Serialize for ImageInput
impl Serialize for ImageInput
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ImageInput
Auto Trait Implementations§
impl Freeze for ImageInput
impl RefUnwindSafe for ImageInput
impl Send for ImageInput
impl Sync for ImageInput
impl Unpin for ImageInput
impl UnsafeUnpin for ImageInput
impl UnwindSafe for ImageInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.