pub struct ImageData {
pub url: Option<String>,
pub b64_json: Option<String>,
pub revised_prompt: Option<String>,
}Expand description
A generated image.
Fields§
§url: Option<String>URL of the generated image (if response_format was “url”).
b64_json: Option<String>Base64-encoded image data (if response_format was “b64_json”).
revised_prompt: Option<String>The revised prompt used for generation.
Implementations§
Source§impl ImageData
impl ImageData
Sourcepub fn decode_base64(&self) -> Option<Result<Vec<u8>, DecodeError>>
pub fn decode_base64(&self) -> Option<Result<Vec<u8>, DecodeError>>
Get the image bytes if base64 data is available.
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 UnsafeUnpin for ImageData
impl UnwindSafe for ImageData
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