MimeKind

Struct MimeKind 

Source
pub struct MimeKind(/* private fields */);
Expand description

Bitmask flags representing different MIME type categories

A MIME type can belong to multiple categories (e.g., an executable can also be an archive). Use bitwise operations to combine or check for multiple kinds.

Implementations§

Source§

impl MimeKind

Source

pub const UNKNOWN: MimeKind

No specific kind assigned

Source

pub const ARCHIVE: MimeKind

Archive formats (ZIP, TAR, 7Z, RAR, etc.)

Source

pub const VIDEO: MimeKind

Video formats (MP4, WebM, AVI, MKV, etc.)

Source

pub const AUDIO: MimeKind

Audio formats (MP3, FLAC, WAV, AAC, etc.)

Source

pub const IMAGE: MimeKind

Image formats (PNG, JPEG, GIF, WebP, etc.)

Source

pub const DOCUMENT: MimeKind

Document formats (PDF, DOCX, ODT, etc.)

Source

pub const TEXT: MimeKind

Text formats (plain text, HTML, XML, JSON, etc.)

Source

pub const FONT: MimeKind

Font formats (TTF, OTF, WOFF, etc.)

Source

pub const EXECUTABLE: MimeKind

Executable/binary formats (ELF, PE, Mach-O, WASM, etc.)

Source

pub const APPLICATION: MimeKind

Application-specific formats (APK, JAR, MSI, etc.)

Source

pub const MODEL: MimeKind

3D model formats (glTF, STL, OBJ, etc.)

Source

pub const DATABASE: MimeKind

Database formats (SQLite, etc.)

Source

pub const SPREADSHEET: MimeKind

Spreadsheet formats (XLSX, ODS, CSV, etc.)

Source

pub const PRESENTATION: MimeKind

Presentation formats (PPTX, ODP, etc.)

Source

pub const fn contains(&self, other: MimeKind) -> bool

Check if this kind contains the specified flag(s)

Source

pub const fn union(self, other: MimeKind) -> MimeKind

Combine this kind with another using bitwise OR

Source

pub const fn is_archive(&self) -> bool

Check if this is an archive format

Source

pub const fn is_video(&self) -> bool

Check if this is a video format

Source

pub const fn is_audio(&self) -> bool

Check if this is an audio format

Source

pub const fn is_image(&self) -> bool

Check if this is an image format

Source

pub const fn is_document(&self) -> bool

Check if this is a document format

Source

pub const fn is_text(&self) -> bool

Check if this is a text format

Source

pub const fn is_font(&self) -> bool

Check if this is a font format

Source

pub const fn is_executable(&self) -> bool

Check if this is an executable/binary format

Source

pub const fn is_application(&self) -> bool

Check if this is an application-specific format

Source

pub const fn is_model(&self) -> bool

Check if this is a 3D model format

Source

pub const fn is_database(&self) -> bool

Check if this is a database format

Source

pub const fn is_spreadsheet(&self) -> bool

Check if this is a spreadsheet format

Source

pub const fn is_presentation(&self) -> bool

Check if this is a presentation format

Trait Implementations§

Source§

impl Clone for MimeKind

Source§

fn clone(&self) -> MimeKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MimeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MimeKind

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for MimeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MimeKind

Source§

fn eq(&self, other: &MimeKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MimeKind

Source§

impl Eq for MimeKind

Source§

impl StructuralPartialEq for MimeKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.