pub enum ImageSize {
Square256,
Square512,
Square1024,
Portrait1024x1792,
Landscape1792x1024,
Custom {
width: u32,
height: u32,
},
}Expand description
Image size options.
Variants§
Square256
256x256 pixels (DALL-E 2 only).
Square512
512x512 pixels (DALL-E 2 only).
Square1024
1024x1024 pixels.
Portrait1024x1792
1024x1792 pixels (portrait).
Landscape1792x1024
1792x1024 pixels (landscape).
Custom
Custom dimensions.
Implementations§
Source§impl ImageSize
impl ImageSize
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Get width and height as a tuple.
Sourcepub fn to_openai_string(self) -> String
pub fn to_openai_string(self) -> String
Convert to OpenAI API size string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageSize
impl<'de> Deserialize<'de> for ImageSize
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 Copy for ImageSize
impl Eq for ImageSize
impl StructuralPartialEq for ImageSize
Auto Trait Implementations§
impl Freeze for ImageSize
impl RefUnwindSafe for ImageSize
impl Send for ImageSize
impl Sync for ImageSize
impl Unpin for ImageSize
impl UnwindSafe for ImageSize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.