ImgBB API wrapper for rust
```rust use imgbb::ImgBB; use tokio;
async fn main() {
let imgbb = ImgBB::new("
let res = match imgbb.upload_file_with_expiration("<PATH>", <SECONDS>).await {
Ok(res) => res,
Err(err) => {
println!("{}", err);
return;
}
};
println!("{:#?}", res);
} ```
```rust use imgbb::ImgBB; use tokio;
async fn main() {
let imgbb = ImgBB::new("<API KEY>");
let ul = imgbb
.read_file("<PATH>").await.expect("Unable to read file")
.expiration(<SECONDS>);
let res = match ul.upload().await {
Ok(res) => res,
Err(err) => {
println!("{}", err);
return;
}
};
println!("{:#?}", res);
} ```
rust
imgbb.read_file("PATH").await
// or
imgbb.upload_file("PATH").await
AsRef<u8>
)rust
imgbb.read_bytes(&[u8])
// or
imgbb.upload_bytes(&[u8])
rust
imgbb.read_base64("BASE64")
// or
imgbb.upload_base64("BASE64")
imgbb-rs is licensed under the GNU GPL v3.0