Skip to main content

ObjectFormatCode

Enum ObjectFormatCode 

Source
#[repr(u16)]
pub enum ObjectFormatCode {
Show 27 variants Undefined = 12_288, Association = 12_289, Script = 12_290, Executable = 12_291, Text = 12_292, Html = 12_293, Dpof = 12_294, Aiff = 12_295, Wav = 12_296, Mp3 = 12_297, Avi = 12_298, Mpeg = 12_299, Asf = 12_300, Jpeg = 14_337, Tiff = 14_340, Gif = 14_343, Bmp = 14_344, Pict = 14_346, Png = 14_347, WmaAudio = 47_361, OggAudio = 47_362, AacAudio = 47_363, FlacAudio = 47_366, WmvVideo = 47_489, Mp4Container = 47_490, M4aAudio = 47_492, Unknown(u16),
}
Expand description

PTP/MTP object format codes.

These codes identify the format/type of objects stored on the device.

Variants§

§

Undefined = 12_288

Undefined/unknown format.

§

Association = 12_289

Association (folder/directory).

§

Script = 12_290

Script file.

§

Executable = 12_291

Executable file.

§

Text = 12_292

Plain text file.

§

Html = 12_293

HTML file.

§

Dpof = 12_294

DPOF (Digital Print Order Format).

§

Aiff = 12_295

AIFF audio.

§

Wav = 12_296

WAV audio.

§

Mp3 = 12_297

MP3 audio.

§

Avi = 12_298

AVI video.

§

Mpeg = 12_299

MPEG video.

§

Asf = 12_300

ASF (Advanced Systems Format).

§

Jpeg = 14_337

JPEG image.

§

Tiff = 14_340

TIFF image.

§

Gif = 14_343

GIF image.

§

Bmp = 14_344

BMP image.

§

Pict = 14_346

PICT image.

§

Png = 14_347

PNG image.

§

WmaAudio = 47_361

WMA audio.

§

OggAudio = 47_362

OGG audio.

§

AacAudio = 47_363

AAC audio.

§

FlacAudio = 47_366

FLAC audio.

§

WmvVideo = 47_489

WMV video.

§

Mp4Container = 47_490

MP4 container.

§

M4aAudio = 47_492

M4A audio.

§

Unknown(u16)

Unknown or vendor-specific format code.

Implementations§

Source§

impl ObjectFormatCode

Source

pub fn from_extension(ext: &str) -> Self

Detect object format from file extension (case insensitive).

Returns Undefined for unrecognized extensions.

Source

pub fn is_audio(&self) -> bool

Check if this format is an audio format.

Source

pub fn is_video(&self) -> bool

Check if this format is a video format.

Source

pub fn is_image(&self) -> bool

Check if this format is an image format.

Trait Implementations§

Source§

impl Clone for ObjectFormatCode

Source§

fn clone(&self) -> ObjectFormatCode

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 ObjectFormatCode

Source§

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

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

impl Default for ObjectFormatCode

Source§

fn default() -> Self

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

impl From<ObjectFormatCode> for u16

Source§

fn from(enum_value: ObjectFormatCode) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for ObjectFormatCode

Source§

fn from(number: u16) -> Self

Converts to this type from the input type.
Source§

impl FromPrimitive for ObjectFormatCode

Source§

type Primitive = u16

Source§

fn from_primitive(number: Self::Primitive) -> Self

Source§

impl Hash for ObjectFormatCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ObjectFormatCode

Source§

fn eq(&self, other: &ObjectFormatCode) -> 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 ObjectFormatCode

Source§

impl Eq for ObjectFormatCode

Source§

impl StructuralPartialEq for ObjectFormatCode

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