VorbisOptimizerError

Enum VorbisOptimizerError 

Source
#[non_exhaustive]
pub enum VorbisOptimizerError {
Show 30 variants InvalidPacketType(TryPacketTypeFromInt), UnexpectedPacketType { expected_type: PacketType, actual_type: PacketType, }, TooSmallPacket(usize), InvalidPattern, UnexpectedHeaderPacketLength { header_type: PacketType, expected_length: usize, actual_length: usize, }, IncompatibleVorbisVersion(u32), InvalidChannelCount(u8), InvalidSamplingFrequency(u32), InvalidBlocksizes(u16, u16), TooBigInteger(TryFromIntError), InvalidSetupValue, TooBigCodewordLength, ReservedLookupType(TryVectorLookupTypeFromInt), InvalidCodebookDimension { codebook: u8, dimensions: u16, expected_dimensions_multiple_of: u32, }, UnsupportedFloorType(u16), InvalidCodebookNumber(u8), RepeatedFloor1Point(u8), TooManyFloor1Points(u8), ReservedResidueType(TryResidueTypeFromInt), ReservedMappingType(u16), InvalidChannelMapping { magnitude_channel: u8, angle_channel: u8, audio_channels: u8, }, InvalidChannelMultiplexing { mux_submap: u8, mapping_submap_count: u8, }, InvalidFloorNumber(u8), InvalidResidueNumber(u8), InvalidMappingNumber(u8), ScalarCodebookUsedInVectorContext(u8), InvalidVectorQuantizationClassbook(usize), InvalidModeNumber(u8), CodebookError(VorbisCodebookError), Io(Error),
}
Expand description

Represents an error that may occur while optimizing a Vorbis stream. This error can be returned by VorbisOptimizer methods.

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

InvalidPacketType(TryPacketTypeFromInt)

A Vorbis packet is of an invalid type.

§

UnexpectedPacketType

A Vorbis packet was not of the expected type within a context.

Fields

§expected_type: PacketType

The expected packet type.

§actual_type: PacketType

The actual packet type.

§

TooSmallPacket(usize)

A Vorbis packet is too small to contain valid data.

§

InvalidPattern

A Vorbis data pattern, such as a fixed signature or sync pattern, was expected but not found in the stream.

§

UnexpectedHeaderPacketLength

A Vorbis header packet does not have the expected length for it to contain valid data.

Fields

§header_type: PacketType

The type of the header packet.

§expected_length: usize

The expected header packet length.

§actual_length: usize

The actual packet length.

§

IncompatibleVorbisVersion(u32)

The Vorbis stream reports to follow an unsupported version of the Vorbis specification.

§

InvalidChannelCount(u8)

The reported number of channels in the Vorbis identification header is not valid.

§

InvalidSamplingFrequency(u32)

The reported sampling frequency in the Vorbis identification header is not valid.

§

InvalidBlocksizes(u16, u16)

The reported block sizes in the Vorbis identification header are not valid.

§

TooBigInteger(TryFromIntError)

A integer conversion failed because the word size of this platform is not wide enough to hold its value. Optimizing on a platform with a bigger word size (i.e., usize size) may help.

§

InvalidSetupValue

A value in the Vorbis I setup header was found to be invalid or incoherent.

§

TooBigCodewordLength

A codebook codeword in the Vorbis I setup header is too long.

§

ReservedLookupType(TryVectorLookupTypeFromInt)

The Vorbis I setup header referenced a codebook lookup type that is reserved by the Vorbis I specification.

§

InvalidCodebookDimension

A Vorbis I audio packet tried to decode a vector using a codebook that yields vectors of dimension zero, which is invalid, or of a dimension that does not fit in the residue vector.

Fields

§codebook: u8

The codebook whose dimension was invalid.

§dimensions: u16

The actual dimension of the codebook vectors.

§expected_dimensions_multiple_of: u32

The number dimensions was expected to be a multiple of.

§

UnsupportedFloorType(u16)

The Vorbis I setup header referenced an unsupported floor type.

§

InvalidCodebookNumber(u8)

The Vorbis I setup header referenced a codebook that is undefined.

§

RepeatedFloor1Point(u8)

The Vorbis I setup header contained a floor configuration of type 1 that referenced duplicated curve X points.

§

TooManyFloor1Points(u8)

The Vorbis I setup header contained a floor configuration of type 1 that contains curve X points than allowed by the specification.

§

ReservedResidueType(TryResidueTypeFromInt)

The Vorbis I setup header referenced a residue type that is reserved by the Vorbis I specification.

§

ReservedMappingType(u16)

The Vorbis I setup header referenced a channel mapping type that is reserved by the Vorbis I specification.

§

InvalidChannelMapping

The Vorbis I setup header referenced a channel mapping that was found to be invalid for the stream.

Fields

§magnitude_channel: u8

The magnitude channel index.

§angle_channel: u8

The angle channel index.

§audio_channels: u8

The number of audio channels, never zero.

§

InvalidChannelMultiplexing

The Vorbis I setup header referenced a channel multiplexing that was found to be invalid for the stream.

Fields

§mux_submap: u8

The submap index.

§mapping_submap_count: u8

The number of available submaps.

§

InvalidFloorNumber(u8)

The Vorbis I setup header referenced a floor that is invalid.

§

InvalidResidueNumber(u8)

The Vorbis I setup header referenced a residue that is invalid.

§

InvalidMappingNumber(u8)

The Vorbis I setup header referenced a mapping that is invalid.

§

ScalarCodebookUsedInVectorContext(u8)

A Vorbis I audio packet tried to decode a vector using a codebook that can only yield scalar values, due to its vector lookup type being “no lookup”.

§

InvalidVectorQuantizationClassbook(usize)

A Vorbis I audio packet tried to decode a residue vector by using a codebook that was not defined.

§

InvalidModeNumber(u8)

A Vorbis I audio packet was encoded with a mode that was not defined in the setup header.

§

CodebookError(VorbisCodebookError)

An error occurred while performing an operation with a Vorbis codebook.

§

Io(Error)

An I/O error occurred while handling a Vorbis packet.

Trait Implementations§

Source§

impl Debug for VorbisOptimizerError

Source§

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

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

impl Display for VorbisOptimizerError

Source§

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

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

impl Error for VorbisOptimizerError

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<Error> for VorbisOptimizerError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for VorbisOptimizerError

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<TryPacketTypeFromInt> for VorbisOptimizerError

Source§

fn from(source: TryPacketTypeFromInt) -> Self

Converts to this type from the input type.
Source§

impl From<TryResidueTypeFromInt> for VorbisOptimizerError

Source§

fn from(source: TryResidueTypeFromInt) -> Self

Converts to this type from the input type.
Source§

impl From<TryVectorLookupTypeFromInt> for VorbisOptimizerError

Source§

fn from(source: TryVectorLookupTypeFromInt) -> Self

Converts to this type from the input type.
Source§

impl From<VorbisCodebookError> for VorbisOptimizerError

Source§

fn from(source: VorbisCodebookError) -> Self

Converts to this type from the input type.
Source§

impl From<VorbisOptimizerError> for RemuxError

Source§

fn from(source: VorbisOptimizerError) -> Self

Converts to this type from the input type.

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