mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 09:47:50 +03:00
User-Agent для reqwest теперь устанавливается с помощью переменной окружения.
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use std::mem::discriminant;
|
||||
|
||||
/// XLS data retrieval errors.
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(Debug)]
|
||||
pub enum FetchError {
|
||||
/// File url is not set.
|
||||
NoUrlProvided,
|
||||
|
||||
/// Unknown error.
|
||||
Unknown,
|
||||
Unknown(reqwest::Error),
|
||||
|
||||
/// Server returned a status code different from 200.
|
||||
BadStatusCode,
|
||||
@@ -19,6 +20,12 @@ pub enum FetchError {
|
||||
BadHeaders,
|
||||
}
|
||||
|
||||
impl PartialEq for FetchError {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
discriminant(self) == discriminant(other)
|
||||
}
|
||||
}
|
||||
|
||||
/// Result of XLS data retrieval.
|
||||
pub struct FetchOk {
|
||||
/// ETag object.
|
||||
|
||||
Reference in New Issue
Block a user