Struct async_openai::types::ImageResponse
source · pub struct ImageResponse {
pub created: u32,
pub data: Vec<Arc<ImageData>>,
}
Fields§
§created: u32
§data: Vec<Arc<ImageData>>
Implementations§
source§impl ImageResponse
impl ImageResponse
sourcepub async fn save<P: AsRef<Path>>(
&self,
dir: P
) -> Result<Vec<PathBuf>, OpenAIError>
pub async fn save<P: AsRef<Path>>( &self, dir: P ) -> Result<Vec<PathBuf>, OpenAIError>
Save each image in a dedicated Tokio task and return paths to saved files. For ResponseFormat::Url each file is downloaded in dedicated Tokio task.
Trait Implementations§
source§impl Clone for ImageResponse
impl Clone for ImageResponse
source§fn clone(&self) -> ImageResponse
fn clone(&self) -> ImageResponse
Returns a copy of the value. Read more
1.0.0 · 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 ImageResponse
impl Debug for ImageResponse
source§impl<'de> Deserialize<'de> for ImageResponse
impl<'de> Deserialize<'de> for ImageResponse
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
source§impl PartialEq<ImageResponse> for ImageResponse
impl PartialEq<ImageResponse> for ImageResponse
source§fn eq(&self, other: &ImageResponse) -> bool
fn eq(&self, other: &ImageResponse) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ImageResponse
impl Serialize for ImageResponse
impl StructuralPartialEq for ImageResponse
Auto Trait Implementations§
impl RefUnwindSafe for ImageResponse
impl Send for ImageResponse
impl Sync for ImageResponse
impl Unpin for ImageResponse
impl UnwindSafe for ImageResponse
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