User-Agent для reqwest теперь устанавливается с помощью переменной окружения.

This commit is contained in:
2025-04-17 22:41:42 +04:00
parent 65376e75f7
commit 9a517519db
5 changed files with 40 additions and 29 deletions

View File

@@ -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.