Enum babycat::Error[][src]

pub enum Error {
Show variants FeatureNotCompiled(&'static str), WrongTimeOffset(u64u64), WrongNumChannels(u32u32), WrongNumChannelsAndMono, CannotZeroPadWithoutSpecifiedLength, UnknownInputEncoding, UnknownDecodeError, UnknownDecodeErrorWithMessage(&'static str), UnknownEncodeError, ResamplingError, ResamplingErrorWithMessage(&'static str), WrongFrameRate(u32u32), WrongFrameRateRatio(u32u32), FilenameIsADirectory(&'static str), FileNotFound(&'static str), UnknownIOError,
}

Variants

FeatureNotCompiled(&'static str)
Expand description

Raised when you are trying to use a feature at runtime that was not included at compile-time.

For example, you may receive this error if you are trying to resample audio using a method that was not compiled for your target or binding.

WrongTimeOffset(u64u64)
Expand description

Raised when DecodeArgs.start_time_milliseconds or DecodeArgs.end_time_milliseconds is invalid.

For example, this error is raised if you set the end timestamp to be before the start timestamp.

WrongNumChannels(u32u32)
Expand description

Raised when you wanted to decode more channels than the audio actually had.

WrongNumChannelsAndMono
Expand description

Raised if you specified DecodeArgs.convert_to_mono as true and DecodeArgs.num_channels as 1.

Setting both parameters is redundant and contradictory. You should either use DecodeArgs.convert_to_mono to flatten all channels or DecodeArgs.num_channels = 1 to select the first channel and discard the rest. You can set DecodeArgs.num_channels n > 1 and use DecodeArgs.convert_to_mono to only flatten those n channels. If you need to select channels in some other way, then do not provide either DecodeArgs.convert_to_mono or DecodeArgs.num_channels. All channels will be decoded and you can decide what to do with them.

CannotZeroPadWithoutSpecifiedLength
Expand description

Raised if you set DecodeArgs.zero_pad_ending as true without also specifying DecodeArgs.end_time_milliseconds.

UnknownInputEncoding
Expand description

Raised when we were not able to detect the encoded input as decodable audio.

UnknownDecodeError
Expand description

Raised when we were not able to decode the given (encoded) audio.

UnknownDecodeErrorWithMessage(&'static str)
Expand description

Raised when we were not able to decode the given (encoded) audio.

UnknownEncodeError
Expand description

Raised when we encountered an unknown error when encoding a waveform into a particular format.

ResamplingError
Expand description

Raised when we were not able to resample the audio.

ResamplingErrorWithMessage(&'static str)
WrongFrameRate(u32u32)
Expand description

Raised when we cannot resample from the input frame rate to the output frame rate.

WrongFrameRateRatio(u32u32)
Expand description

Raised if you are trying upsample or downsample audio by a factor greater than 256.

FilenameIsADirectory(&'static str)
Expand description

Raised if you asked Babycat to read a file but gave it a path to a directory.

FileNotFound(&'static str)
Expand description

Raised if you asked Babycat to read a file that does not exist.

UnknownIOError
Expand description

Raised when something else went wrong while doing I/O.

Implementations

impl Error[src]

pub fn error_type(&self) -> String[src]

Trait Implementations

impl Clone for Error[src]

fn clone(&self) -> Error[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Error[src]

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

Formats the value using the given formatter. Read more

impl Deserialize<'static> for Error[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'static>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for Error[src]

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

Formats the value using the given formatter. Read more

impl Error for Error[src]

fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]

The lower-level source of this error, if any. Read more

fn backtrace(&self) -> Option<&Backtrace>[src]

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

fn description(&self) -> &str1.0.0[src]

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

impl PartialEq<Error> for Error[src]

fn eq(&self, other: &Error) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Error) -> bool[src]

This method tests for !=.

impl Serialize for Error[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Copy for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<F, T> IntoSample<T> for F where
    T: FromSample<F>, 

pub fn into_sample(self) -> T

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.