pub enum YdlError {
Show 25 variants
InvalidUrl {
url: String,
},
InvalidVideoId {
video_id: String,
},
Network {
source: Error,
},
VideoNotFound {
video_id: String,
},
VideoRestricted {
video_id: String,
},
GeoBlocked {
video_id: String,
},
AgeRestricted {
video_id: String,
},
NoSubtitlesAvailable {
video_id: String,
},
OnlyAutoGenerated {
video_id: String,
},
LanguageNotAvailable {
language: String,
},
UnsupportedFormat {
format: String,
},
MetadataParsingError {
message: String,
},
SubtitleDiscoveryError {
message: String,
},
FileSystem {
source: Error,
},
SubtitleParsing {
message: String,
},
FormatConversion {
from: String,
to: String,
},
RateLimited {
retry_after: u64,
},
Timeout {
timeout: u64,
},
ServiceUnavailable,
Configuration {
message: String,
},
Processing {
message: String,
},
JsonParsing {
source: Error,
},
UrlParsing {
source: ParseError,
},
Regex {
source: Error,
},
Encoding {
message: String,
},
}
Expand description
Main error type for the Ydl API
Variants§
InvalidUrl
InvalidVideoId
Network
VideoNotFound
VideoRestricted
GeoBlocked
AgeRestricted
NoSubtitlesAvailable
OnlyAutoGenerated
LanguageNotAvailable
UnsupportedFormat
MetadataParsingError
SubtitleDiscoveryError
FileSystem
SubtitleParsing
FormatConversion
RateLimited
Timeout
Configuration
Processing
JsonParsing
UrlParsing
Fields
§
source: ParseError
Regex
Encoding
Implementations§
Source§impl YdlError
impl YdlError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if the error is retryable
Sourcepub fn retry_delay(&self) -> Option<u64>
pub fn retry_delay(&self) -> Option<u64>
Get suggested retry delay in seconds
Sourcepub fn is_video_inaccessible(&self) -> bool
pub fn is_video_inaccessible(&self) -> bool
Check if error indicates the video content is inaccessible
Check if error indicates subtitle availability issues
Trait Implementations§
Source§impl Error for YdlError
impl Error for YdlError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ParseError> for YdlError
impl From<ParseError> for YdlError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for YdlError
impl !RefUnwindSafe for YdlError
impl Send for YdlError
impl Sync for YdlError
impl Unpin for YdlError
impl !UnwindSafe for YdlError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.