pub enum NetworkError {
Http {
status: u16,
message: String,
},
Connection(String),
Timeout(u64),
InvalidUrl(String),
NotFound(String),
ChecksumMismatch {
fragment_id: String,
expected: String,
actual: String,
},
Cache(String),
RetriesExhausted(String),
RateLimited {
retry_after_ms: u64,
},
Configuration(String),
Io(Error),
Cancelled,
}Expand description
Errors that can occur during network operations
Variants§
Http
HTTP request failed
Connection(String)
Network connection failed
Timeout(u64)
Request timeout
InvalidUrl(String)
Invalid URL
NotFound(String)
Fragment not found on CDN
ChecksumMismatch
Checksum mismatch
Cache(String)
Cache error
RetriesExhausted(String)
All retries exhausted
RateLimited
Rate limited
Configuration(String)
CDN configuration error
Io(Error)
IO error
Cancelled
Cancelled
Implementations§
Source§impl NetworkError
impl NetworkError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Get retry delay if rate limited
Trait Implementations§
Source§impl Debug for NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
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<Error> for NetworkError
impl From<Error> for NetworkError
Source§impl From<Error> for NetworkError
impl From<Error> for NetworkError
Source§impl From<ParseError> for NetworkError
impl From<ParseError> for NetworkError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetworkError
impl !RefUnwindSafe for NetworkError
impl Send for NetworkError
impl Sync for NetworkError
impl Unpin for NetworkError
impl !UnwindSafe for NetworkError
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