#[non_exhaustive]pub enum SubtitleDecodeError {
Decode(Error),
Convert(ConvertError),
AfterEof,
}Expand description
Errors from [FfmpegSubtitleStreamDecoder] — faults and the
send-side refusal.
NoFrameReady used to be here, and it was the crate’s worst
conflation: send_eof on this backend is a no-op, so “no cue yet”
and “there will be no more cues” were the same value, and a caller
draining to the end of a subtitle track had nothing to stop on. Both
are Received states now — Received::NeedsInput and
Received::Ended — told apart by the session’s own EOF latch.
Open fault taxonomy, so it is #[non_exhaustive]. New ways to
fail are discovered — a backend, a ceiling, a corruption a codec
learns to report — and a consumer that meets one it has never heard
of should take its generic-fault path. That is exactly what the
wildcard arm this attribute forces is for. The two status
vocabularies opposite it,
Sent and Received,
are exhaustive for the mirror-image reason: their arms are the
substrate’s fixed state set, and there the wildcard would be dead
weight hiding a state a consumer forgot.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Decode(Error)
The wrapped ffmpeg::decoder::Subtitle reported an error.
Convert(ConvertError)
Conversion from FFmpeg’s AVSubtitle to mediadecode’s
SubtitleFrame failed.
AfterEof
send_packet was called after
send_eof. Call
flush first to reuse the decoder for
another stream.
A caller usage fault, not back pressure, which is the line
that keeps it here while the held-cue refusal became
Sent::MustDrain. Draining changes nothing about it: this
session will refuse every packet until flush, so answering
MustDrain would send the caller into a loop with no exit — and,
worse, the loop’s next offer would be accepted, reversing a
terminal Received::Ended.
Named AfterEof rather than AtEof because that is what this
crate already calls the condition one seam over
(ResampleError::AfterEof), and
one condition deserves one word.
Implementations§
Source§impl SubtitleDecodeError
impl SubtitleDecodeError
Sourcepub const fn is_decode(&self) -> bool
pub const fn is_decode(&self) -> bool
Returns true if this value is of type Decode. Returns false otherwise
Sourcepub const fn is_convert(&self) -> bool
pub const fn is_convert(&self) -> bool
Returns true if this value is of type Convert. Returns false otherwise
Sourcepub const fn is_after_eof(&self) -> bool
pub const fn is_after_eof(&self) -> bool
Returns true if this value is of type AfterEof. Returns false otherwise
Source§impl SubtitleDecodeError
impl SubtitleDecodeError
Sourcepub fn unwrap_decode(self) -> Error
pub fn unwrap_decode(self) -> Error
Unwraps this value to the SubtitleDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decode_ref(&self) -> &Error
pub fn unwrap_decode_ref(&self) -> &Error
Unwraps this reference to the SubtitleDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decode_mut(&mut self) -> &mut Error
pub fn unwrap_decode_mut(&mut self) -> &mut Error
Unwraps this mutable reference to the SubtitleDecodeError::Decode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert(self) -> ConvertError
pub fn unwrap_convert(self) -> ConvertError
Unwraps this value to the SubtitleDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert_ref(&self) -> &ConvertError
pub fn unwrap_convert_ref(&self) -> &ConvertError
Unwraps this reference to the SubtitleDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_convert_mut(&mut self) -> &mut ConvertError
pub fn unwrap_convert_mut(&mut self) -> &mut ConvertError
Unwraps this mutable reference to the SubtitleDecodeError::Convert variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_after_eof(self)
pub fn unwrap_after_eof(self)
Unwraps this value to the SubtitleDecodeError::AfterEof variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_after_eof_ref(&self)
pub fn unwrap_after_eof_ref(&self)
Unwraps this reference to the SubtitleDecodeError::AfterEof variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_after_eof_mut(&mut self)
pub fn unwrap_after_eof_mut(&mut self)
Unwraps this mutable reference to the SubtitleDecodeError::AfterEof variant.
Panics if this value is of any other type.
Source§impl SubtitleDecodeError
impl SubtitleDecodeError
Sourcepub fn try_unwrap_decode(self) -> Result<Error, TryUnwrapError<Self>>
pub fn try_unwrap_decode(self) -> Result<Error, TryUnwrapError<Self>>
Attempts to unwrap this value to the SubtitleDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_decode_ref(&self) -> Result<&Error, TryUnwrapError<&Self>>
pub fn try_unwrap_decode_ref(&self) -> Result<&Error, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the SubtitleDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_decode_mut(
&mut self,
) -> Result<&mut Error, TryUnwrapError<&mut Self>>
pub fn try_unwrap_decode_mut( &mut self, ) -> Result<&mut Error, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the SubtitleDecodeError::Decode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert(self) -> Result<ConvertError, TryUnwrapError<Self>>
pub fn try_unwrap_convert(self) -> Result<ConvertError, TryUnwrapError<Self>>
Attempts to unwrap this value to the SubtitleDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert_ref(
&self,
) -> Result<&ConvertError, TryUnwrapError<&Self>>
pub fn try_unwrap_convert_ref( &self, ) -> Result<&ConvertError, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the SubtitleDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_convert_mut(
&mut self,
) -> Result<&mut ConvertError, TryUnwrapError<&mut Self>>
pub fn try_unwrap_convert_mut( &mut self, ) -> Result<&mut ConvertError, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the SubtitleDecodeError::Convert variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_after_eof(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_after_eof(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the SubtitleDecodeError::AfterEof variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_after_eof_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_after_eof_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the SubtitleDecodeError::AfterEof variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_after_eof_mut(
&mut self,
) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_after_eof_mut( &mut self, ) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the SubtitleDecodeError::AfterEof variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl Debug for SubtitleDecodeError
impl Debug for SubtitleDecodeError
Source§impl Display for SubtitleDecodeError
impl Display for SubtitleDecodeError
Source§impl Error for SubtitleDecodeError
impl Error for SubtitleDecodeError
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
use the Display impl or to_string()