pub struct ImageUrl {
pub url: String,
pub detail: Option<String>,
}Expand description
Represents an image URL with optional metadata
Fields§
§url: StringThe URL of the image
detail: Option<String>Optional detail level (for some providers)
Implementations§
Source§impl ImageUrl
impl ImageUrl
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Creates a new image URL
§Examples
use language_barrier_core::message::ImageUrl;
let image_url = ImageUrl::new("https://example.com/image.jpg");Sourcepub fn with_detail(self, detail: impl Into<String>) -> Self
pub fn with_detail(self, detail: impl Into<String>) -> Self
Sets the detail level and returns self for method chaining
§Examples
use language_barrier_core::message::ImageUrl;
let image_url = ImageUrl::new("https://example.com/image.jpg")
.with_detail("high");Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageUrl
impl<'de> Deserialize<'de> for ImageUrl
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 StructuralPartialEq for ImageUrl
Auto Trait Implementations§
impl Freeze for ImageUrl
impl RefUnwindSafe for ImageUrl
impl Send for ImageUrl
impl Sync for ImageUrl
impl Unpin for ImageUrl
impl UnwindSafe for ImageUrl
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