Struct lofty::properties::FileProperties

source ·
#[non_exhaustive]
pub struct FileProperties { /* private fields */ }
Expand description

Various immutable audio properties

Implementations§

source§

impl FileProperties

source

pub const fn new( duration: Duration, overall_bitrate: Option<u32>, audio_bitrate: Option<u32>, sample_rate: Option<u32>, bit_depth: Option<u8>, channels: Option<u8>, channel_mask: Option<ChannelMask> ) -> Self

Create a new FileProperties

source

pub fn duration(&self) -> Duration

Duration of the audio

source

pub fn overall_bitrate(&self) -> Option<u32>

Overall bitrate (kbps)

source

pub fn audio_bitrate(&self) -> Option<u32>

Audio bitrate (kbps)

source

pub fn sample_rate(&self) -> Option<u32>

Sample rate (Hz)

source

pub fn bit_depth(&self) -> Option<u8>

Bits per sample (usually 16 or 24 bit)

source

pub fn channels(&self) -> Option<u8>

Channel count

source

pub fn channel_mask(&self) -> Option<ChannelMask>

Channel mask

Trait Implementations§

source§

impl Clone for FileProperties

source§

fn clone(&self) -> FileProperties

Returns a copy 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 FileProperties

source§

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

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

impl Default for FileProperties

source§

fn default() -> Self

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

impl From<AACProperties> for FileProperties

source§

fn from(input: AACProperties) -> Self

Converts to this type from the input type.
source§

impl From<AiffProperties> for FileProperties

source§

fn from(value: AiffProperties) -> Self

Converts to this type from the input type.
source§

impl From<ApeProperties> for FileProperties

source§

fn from(input: ApeProperties) -> Self

Converts to this type from the input type.
source§

impl From<FlacProperties> for FileProperties

source§

fn from(input: FlacProperties) -> Self

Converts to this type from the input type.
source§

impl From<Mp4Properties> for FileProperties

source§

fn from(input: Mp4Properties) -> Self

Converts to this type from the input type.
source§

impl From<MpcProperties> for FileProperties

source§

fn from(input: MpcProperties) -> Self

Converts to this type from the input type.
source§

impl From<MpcSv4to6Properties> for FileProperties

source§

fn from(input: MpcSv4to6Properties) -> Self

Converts to this type from the input type.
source§

impl From<MpcSv7Properties> for FileProperties

source§

fn from(input: MpcSv7Properties) -> Self

Converts to this type from the input type.
source§

impl From<MpcSv8Properties> for FileProperties

source§

fn from(input: MpcSv8Properties) -> Self

Converts to this type from the input type.
source§

impl From<MpegProperties> for FileProperties

source§

fn from(input: MpegProperties) -> Self

Converts to this type from the input type.
source§

impl From<OpusProperties> for FileProperties

source§

fn from(input: OpusProperties) -> Self

Converts to this type from the input type.
source§

impl From<SpeexProperties> for FileProperties

source§

fn from(input: SpeexProperties) -> Self

Converts to this type from the input type.
source§

impl From<VorbisProperties> for FileProperties

source§

fn from(input: VorbisProperties) -> Self

Converts to this type from the input type.
source§

impl From<WavPackProperties> for FileProperties

source§

fn from(input: WavPackProperties) -> Self

Converts to this type from the input type.
source§

impl From<WavProperties> for FileProperties

source§

fn from(input: WavProperties) -> Self

Converts to this type from the input type.
source§

impl PartialEq for FileProperties

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for FileProperties

source§

impl StructuralPartialEq for FileProperties

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

§

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

§

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

§

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.