Inital commit

This commit is contained in:
Leon Grünewald 2024-01-01 21:50:57 +01:00
commit 07c7c42eb9
5 changed files with 1124 additions and 0 deletions

1092
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

9
Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "r621"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = "0.11.23"

BIN
src/.client.rs.swp Normal file

Binary file not shown.

22
src/client.rs Normal file
View file

@ -0,0 +1,22 @@
#[derive(Clone, Copy, Debug)]
pub struct Client<'a> {
auth: Authentication<'a>,
useragent: &'a str,
url: &'static str
}
impl<'a> Client<'a> {
pub fn new(auth: Authentication<'a>, useragent: &'a str) -> Self {
Client {
auth,
useragent,
url: "https://e621.net"
}
}
}
#[derive(Clone, Copy, Debug)]
pub enum Authentication<'a> {
Authorized {username: &'a str, apikey: &'a str},
Unauthorized
}

1
src/lib.rs Normal file
View file

@ -0,0 +1 @@
mod client;