Enum Error

Source
#[non_exhaustive]
pub enum Error {
Show 65 variants Io(Error), Utf8(Box<FromUtf8Error>), MissingFlacTag, MissingStreaminfo, MultipleStreaminfo, MultipleSeekTable, MultipleVorbisComment, InvalidSeekTableSize, InvalidSeekTablePoint, Cuesheet(CuesheetError), InvalidPictureType, MultiplePngIcon, MultipleGeneralIcon, ReservedMetadataBlock, InvalidMetadataBlock, InvalidMetadataBlockSize, InsufficientApplicationBlock, ExcessiveVorbisEntries, ExcessiveStringLength, ExcessivePictureSize, ShortBlock, ExcessiveBlockSize, InvalidSyncCode, InvalidBlockSize, BlockSizeMismatch, InvalidSampleRate, NonSubsetSampleRate, NonSubsetBitsPerSample, SampleRateMismatch, ExcessiveChannels, InvalidChannels, ChannelsMismatch, InvalidBitsPerSample, ExcessiveBps, BitsPerSampleMismatch, InvalidFrameNumber, InvalidSeek, ExcessiveFrameNumber, Crc8Mismatch, Crc16Mismatch, InvalidSubframeHeader, InvalidSubframeHeaderType, ExcessiveWastedBits, MissingResiduals, InvalidCodingMethod, InvalidPartitionOrder, InvalidFixedOrder, InvalidLpcOrder, InvalidQlpPrecision, NegativeLpcShift, NoBestLpcOrder, InsufficientLpcSamples, ZeroLpCoefficients, LpNegativeShiftError, AccumulatorOverflow, TooManySamples, ExcessiveTotalSamples, NoSamples, SampleCountMismatch, ResidualOverflow, SamplesNotDivisibleByChannels, InvalidTotalBytes, InvalidTotalSamples, ChannelCountMismatch, ChannelLengthMismatch,
}
Expand description

A unified FLAC error

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io(Error)

A general I/O error from the underlying stream

§

Utf8(Box<FromUtf8Error>)

A UTF-8 formatting error

§

MissingFlacTag

A FLAC file missing its initial “fLaC” file tag

§

MissingStreaminfo

A FLAC file missing its initial STREAMINFO block

§

MultipleStreaminfo

A FLAC file containing multiple STREAMINFO blocks

§

MultipleSeekTable

A FLAC file containing multiple SEEKTABLE blocks

§

MultipleVorbisComment

A FLAC file containing multiple VORBIS_COMMENT blocks

§

InvalidSeekTableSize

A SEEKTABLE block whose size isn’t evenly divisible by a whole of number of seek points.

§

InvalidSeekTablePoint

A SEEKTABLE point whose offset does not increment properly

§

Cuesheet(CuesheetError)

A CUESHEET-specific error

§

InvalidPictureType

An undefined PICTURE type

§

MultiplePngIcon

Multiple 32x32 PNG icons defined

§

MultipleGeneralIcon

Multiple general file icons defined

§

ReservedMetadataBlock

A reserved metadata block encountered

§

InvalidMetadataBlock

An invalid metadata block encountered

§

InvalidMetadataBlockSize

A metadata block’s contents are smaller than the size indicated in the metadata block header.

§

InsufficientApplicationBlock

An APPLICATION metadata block which is not large enough to hold any contents beyond its ID.

§

ExcessiveVorbisEntries

A VorbisComment struct with more entries that can fit in a u32

§

ExcessiveStringLength

A VorbisComment or Picture struct with strings longer than a u32

§

ExcessivePictureSize

A Picture struct whose data is larger than a u32

§

ShortBlock

A block size less than 15 that’s not the last block

§

ExcessiveBlockSize

A metadata block larger than its 24-bit size field can hold

§

InvalidSyncCode

Invalid frame sync code

§

InvalidBlockSize

Invalid frame block size

§

BlockSizeMismatch

Block size in frame is larger than maximum block size in STREAMINFO

§

InvalidSampleRate

Invalid frame sample rate

§

NonSubsetSampleRate

Non-subset frame sample rate

§

NonSubsetBitsPerSample

Non-subset frame bits-per-sample

§

SampleRateMismatch

Mismatch between frame sample rate and STREAMINFO sample rate

§

ExcessiveChannels

Excessive channel count

§

InvalidChannels

Invalid frame channel assignment

§

ChannelsMismatch

Channel count in frame differs from channel count in STREAMINFO

§

InvalidBitsPerSample

Invalid frame bits-per-sample

§

ExcessiveBps

Excessive number of bits-per-sample

§

BitsPerSampleMismatch

Bits-per-sample in frame differs from bits-per-sample in STREAMINFO

§

InvalidFrameNumber

Invalid frame number

§

InvalidSeek

Seeking beyond end of file

§

ExcessiveFrameNumber

Excessive frame number

§

Crc8Mismatch

CRC-8 mismatch in frame header

§

Crc16Mismatch

CRC-16 mismatch in frame footer

§

InvalidSubframeHeader

Invalid subframe header

§

InvalidSubframeHeaderType

Invalid subframe header type

§

ExcessiveWastedBits

Excessive number of wasted bits-per-sample

§

MissingResiduals

Insufficient number of residuals in residuals block

§

InvalidCodingMethod

Invalid residual coding method

§

InvalidPartitionOrder

Invalid residual partition order

§

InvalidFixedOrder

Invalid FIXED subframe predictor order

§

InvalidLpcOrder

Invalid LPC subframe predictor order

§

InvalidQlpPrecision

Invalid coefficient precision bits

§

NegativeLpcShift

Negative shift value in LPC subframe

§

NoBestLpcOrder

Unable to determine best LPC order

§

InsufficientLpcSamples

Insufficient samples for LPC subframe

§

ZeroLpCoefficients

LP coefficients are all 0

§

LpNegativeShiftError

Excessive negative shift in LP quantization

§

AccumulatorOverflow

Accumulator overflow in LPC subframe

§

TooManySamples

Too many samples encountered in stream

§

ExcessiveTotalSamples

Too many samples requested by encoder

§

NoSamples

No samples written by encoder

§

SampleCountMismatch

Number of samples written to stream differs from expected

§

ResidualOverflow

Residual overflow

§

SamplesNotDivisibleByChannels

Number of samples not evenly divisible by number of channels

§

InvalidTotalBytes

Invalid total byte count

§

InvalidTotalSamples

Invalid total samples count

§

ChannelCountMismatch

Number of channels sent to encoder is incorrect

§

ChannelLengthMismatch

Channels sent to encoder are not all the same length

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CuesheetError> for Error

Source§

fn from(error: CuesheetError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(error: FromUtf8Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

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