pub struct ImageData {
pub url: Option<String>,
pub b64_json: Option<String>,
pub revised_prompt: Option<String>,
}Expand description
Individual image data in the response
Fields§
§url: Option<String>The URL of the generated image (if response_format is url)
b64_json: Option<String>The base64-encoded image data (if response_format is b64_json)
revised_prompt: Option<String>The revised prompt used for generation (DALL-E 3 only)
Implementations§
Source§impl ImageData
impl ImageData
Sourcepub fn has_b64_json(&self) -> bool
pub fn has_b64_json(&self) -> bool
Check if this image data contains base64 data
Sourcepub fn get_b64_json(&self) -> Option<&str>
pub fn get_b64_json(&self) -> Option<&str>
Get the base64 image data if available
Sourcepub fn get_revised_prompt(&self) -> Option<&str>
pub fn get_revised_prompt(&self) -> Option<&str>
Get the revised prompt if available (DALL-E 3 only)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageData
impl<'de> Deserialize<'de> for ImageData
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 ImageData
impl RefUnwindSafe for ImageData
impl Send for ImageData
impl Sync for ImageData
impl Unpin for ImageData
impl UnwindSafe for ImageData
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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