Inital commit
This commit is contained in:
commit
07c7c42eb9
5 changed files with 1124 additions and 0 deletions
1092
Cargo.lock
generated
Normal file
1092
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
9
Cargo.toml
Normal file
9
Cargo.toml
Normal 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
BIN
src/.client.rs.swp
Normal file
Binary file not shown.
22
src/client.rs
Normal file
22
src/client.rs
Normal 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
1
src/lib.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod client;
|
Loading…
Reference in a new issue