Enum lewton::header::HeaderReadError
source · pub enum HeaderReadError {
EndOfPacket,
NotVorbisHeader,
UnsupportedVorbisVersion,
HeaderBadFormat,
HeaderBadType(u8),
HeaderIsAudio,
Utf8DecodeError,
BufferNotAddressable,
}
Expand description
Errors that can occur during Header decoding
Variants§
EndOfPacket
NotVorbisHeader
If the passed data don’t start with the “vorbis” capture pattern, this error is returned.
UnsupportedVorbisVersion
HeaderBadFormat
If the header violates the vorbis spec
HeaderBadType(u8)
The given packet indeed seems to be a vorbis header, but it looks like it is a different header type than the function it was passed to.
It is not guaranteed that the type is a valid header type.
HeaderIsAudio
The given packet does not seem to be a header as per vorbis spec, instead it seems to be an audio packet.
Utf8DecodeError
BufferNotAddressable
If the needed memory isn’t addressable by us
This error is returned if a calculation yielded a higher value for an internal buffer size that doesn’t fit into the platform’s address range. Note that if we “simply” encounter an allocation failure (OOM, etc), we do what libstd does in these cases: crash.
This error is not automatically an error of the passed data, but rather is due to insufficient decoder hardware.
Trait Implementations§
source§impl Debug for HeaderReadError
impl Debug for HeaderReadError
source§impl Display for HeaderReadError
impl Display for HeaderReadError
source§impl Error for HeaderReadError
impl Error for HeaderReadError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<()> for HeaderReadError
impl From<()> for HeaderReadError
source§fn from(_: ()) -> HeaderReadError
fn from(_: ()) -> HeaderReadError
source§impl From<Error> for HeaderReadError
impl From<Error> for HeaderReadError
source§fn from(err: Error) -> HeaderReadError
fn from(err: Error) -> HeaderReadError
source§impl From<FromUtf8Error> for HeaderReadError
impl From<FromUtf8Error> for HeaderReadError
source§fn from(_: FromUtf8Error) -> HeaderReadError
fn from(_: FromUtf8Error) -> HeaderReadError
source§impl From<HeaderReadError> for VorbisError
impl From<HeaderReadError> for VorbisError
source§fn from(err: HeaderReadError) -> VorbisError
fn from(err: HeaderReadError) -> VorbisError
source§impl PartialEq for HeaderReadError
impl PartialEq for HeaderReadError
source§fn eq(&self, other: &HeaderReadError) -> bool
fn eq(&self, other: &HeaderReadError) -> bool
self
and other
values to be equal, and is used
by ==
.