#[non_exhaustive]pub enum Error {
ReadError(OggReadError),
NotOpus,
MissingPacket,
DataError(Error),
MalformedComment(String),
UTFError(FromUtf8Error),
TooBigError,
PictureError(PictureError),
PlatformError(TryFromIntError),
}
Expand description
Error type.
Encapsulates every error that could occur in the usage of this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ReadError(OggReadError)
Failed to read an ogg packet, or the file is not an ogg file
NotOpus
The selected file is an ogg file, but not an opus file.
MissingPacket
Expected a packet (for example, the comment header packet), but the stream ended early
DataError(Error)
An error occured while trying to execute an io operation. If the underlying ErrorKind
is a
ErrorKind::UnexpectedEof
, then it usually means that
a piece of data, either an ogg packet or an encoded image, was shorter than expected by the
spec.
MalformedComment(String)
A comment was not in TAG=VALUE format. The offending line in the comment header is provided for convenience.
UTFError(FromUtf8Error)
Expected valid UTF-8 data as mandated by the spec, but did not receive it. The underlying
FromUtf8Error
provides the offending bytes for conveniece.
TooBigError
The content was too big for the opus spec (e.g. is more than u32::MAX
bytes long). Since
u32::MAX
bytes is almost 4.3 GB, this error should almost never occur.
PictureError(PictureError)
An error occured while encoding or decoding a Picture
. See PictureError
for more info.
PlatformError(TryFromIntError)
Raised if the platform’s usize
is smaller than 32 bits. This error is raised because
the opus spec uses u32 for lengths, but Rust uses usize instead.