Struct Format

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

A type representing the possible data types used in communication with mpv.

Implementations§

Source§

impl Format

Source

pub const NONE: Format

A Format representing MPV_FORMAT_NONE, sometimes returned from mpv to denote an error or other special circumstance.

Source

pub const STRING: Format

A Format representing Rust’s String and mpv’s MPV_FORMAT_STRING.

It represents a raw property string, like using ${=property} in input.conf. See the mpv docs on raw and formatted properties.

§Warning

Although the encoding is usually UTF-8, this is not always the case. File tags often store strings in some legacy codepage, and even filenames don’t necessarily have to be in UTF-8 (at least on Linux).

If this crate receives invalid UTF-8, a RustError::InvalidUtf8 may be returned.

On Windows, filenames are always UTF-8, and libmpv converts between UTF-8 and UTF-16 when using Win32 API functions.

Source

pub const OSD_STRING: Format

A Format representing OsdString (a New Type around String) and mpv’s MPV_FORMAT_OSD_STRING.

It represents an OSD property string, like using ${property} in input.conf. See the mpv docs on raw and formatted properties.

In many cases, this is the same as the raw string, but in other cases it’s formatted for display on OSD.

It’s intended to be human-readable. Do not attempt to parse these strings.

Source

pub const FLAG: Format

A Format representing Rust’s bool and mpv’s MPV_FORMAT_FLAG.

Source

pub const INT64: Format

A Format representing Rust’s i64 and mpv’s MPV_FORMAT_INT64.

Source

pub const DOUBLE: Format

A Format representing Rust’s f64 and mpv’s MPV_FORMAT_DOUBLE.

Source

pub const NODE: Format

A Format representing the crate’s Node and mpv’s MPV_FORMAT_NODE.

Source

pub const NODE_ARRAY: Format

A Format representing the crate’s NodeArray (a type alias for Vec<Node>) and mpv’s MPV_FORMAT_NODE_ARRAY.

Source

pub const NODE_MAP: Format

A Format representing the crate’s NodeMap (a type alias for HashMap<String, Node>) and mpv’s MPV_FORMAT_NODE_MAP.

Source

pub const BYTE_ARRAY: Format

A Format representing the crate’s ByteArray (a type alias for Vec<u8>) and mpv’s MPV_FORMAT_BYTE_ARRAY.

Auto Trait Implementations§

§

impl Freeze for Format

§

impl RefUnwindSafe for Format

§

impl Send for Format

§

impl Sync for Format

§

impl Unpin for Format

§

impl UnwindSafe for Format

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