#[non_exhaustive]pub struct ImageOptions {
pub format: Option<ImageFormat>,
pub size: Option<ImageSize>,
pub force_static: bool,
}Expand description
The format and size of an image URL.
discord.js counterpart: ImageURLOptions (@discordjs/rest).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.format: Option<ImageFormat>The format; None is WebP, animated for animated images (D-138).
size: Option<ImageSize>The size; None lets Discord pick the original size.
force_static: boolWhether animated images are returned as a still image.
Implementations§
Source§impl ImageOptions
impl ImageOptions
Sourcepub const fn new() -> Self
pub const fn new() -> Self
The default options: WebP (animated when the image is), original size.
discord.js counterpart: ImageURLOptions (@discordjs/rest).
Sourcepub const fn format(self, format: ImageFormat) -> Self
pub const fn format(self, format: ImageFormat) -> Self
Sets the format.
discord.js counterpart: the extension of ImageURLOptions (@discordjs/rest).
Sourcepub const fn size(self, size: ImageSize) -> Self
pub const fn size(self, size: ImageSize) -> Self
Sets the size.
discord.js counterpart: the size of ImageURLOptions (@discordjs/rest).
Sourcepub const fn force_static(self, force_static: bool) -> Self
pub const fn force_static(self, force_static: bool) -> Self
Returns a still image even for an animated one.
discord.js counterpart: the forceStatic of ImageURLOptions (@discordjs/rest).
Trait Implementations§
Source§impl Clone for ImageOptions
impl Clone for ImageOptions
impl Copy for ImageOptions
Source§impl Debug for ImageOptions
impl Debug for ImageOptions
Source§impl Default for ImageOptions
impl Default for ImageOptions
impl Eq for ImageOptions
Source§impl Hash for ImageOptions
impl Hash for ImageOptions
Source§impl PartialEq for ImageOptions
impl PartialEq for ImageOptions
impl StructuralPartialEq for ImageOptions
Auto Trait Implementations§
impl Freeze for ImageOptions
impl RefUnwindSafe for ImageOptions
impl Send for ImageOptions
impl Sync for ImageOptions
impl Unpin for ImageOptions
impl UnsafeUnpin for ImageOptions
impl UnwindSafe for ImageOptions
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.