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 ==
.