pub enum ImageFormat {
Png,
Jpeg,
Gif,
Bmp,
}Expand description
An image’s file format, also determining its media content type.
Only the handful of raster formats Word natively displays inline are modeled; vector formats (e.g. EMF/WMF metafiles) and other DrawingML content (shapes, charts) are out of scope for now.
Variants§
Implementations§
Source§impl ImageFormat
impl ImageFormat
Sourcepub fn extension(self) -> &'static str
pub fn extension(self) -> &'static str
The file extension used for this format’s media part (e.g. word/media/image1.png), without
the leading dot.
Sourcepub fn content_type(self) -> &'static str
pub fn content_type(self) -> &'static str
The media part’s content type ([Content_Types].xml Override value).
Sourcepub fn from_extension(name: &str) -> Option<ImageFormat>
pub fn from_extension(name: &str) -> Option<ImageFormat>
Guesses the format from a part name’s or file name’s extension (case-insensitive), or None
if it isn’t one of the formats we support.
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImageFormat
Source§impl Debug for ImageFormat
impl Debug for ImageFormat
impl Eq for ImageFormat
Source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnsafeUnpin for ImageFormat
impl UnwindSafe for ImageFormat
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.