mirror of
https://github.com/MedzikUser/imgurs
synced 2024-08-15 00:03:19 +00:00
56 lines
1.3 KiB
Rust
56 lines
1.3 KiB
Rust
//! This crate is an unofficial implementation of the [Imgur API](https://imgur.com) in Rust.
|
|
//!
|
|
//! # Installation
|
|
//!
|
|
//! ## Requirements
|
|
//! - Rust 1.58 (earlier versions are not tested (only the latest stable version is tested!))
|
|
//! - Network connection
|
|
//!
|
|
//! ## Importing
|
|
//! The driver is available on [crates.io](https://crates.io/crates/imgurs). To use the driver in
|
|
//! your application, simply add it to your project's `Cargo.toml`.
|
|
//! ```toml
|
|
//! [dependencies]
|
|
//! imgurs = "0.7.3"
|
|
//! ```
|
|
//!
|
|
//! # Example Usage
|
|
//!
|
|
//! ## Create new ImgurClient
|
|
//! ```ignore
|
|
//! use imgurs::ImgurClient;
|
|
//!
|
|
//! let client = ImgurClient::new("client id");
|
|
//! ```
|
|
//!
|
|
//! ## Image Upload
|
|
//! ```ignore
|
|
//! // From URL
|
|
//! let info = client.upload_image("https://i.imgur.com/lFaGr1x.png").await?;
|
|
//!
|
|
//! // From File
|
|
//! let info = client.upload_image("path/to/image.png").await?;
|
|
//! ```
|
|
//!
|
|
//! ## Delete Image
|
|
//! ```ignore
|
|
//! client.delete_image("SuPeRsEcReTDeLeTeHaSh").await?; // delete hash
|
|
//! ```
|
|
//!
|
|
//! ## Get Image Info
|
|
//! ```ignore
|
|
//! let info = client.image_info("lFaGr1x").await?; // image id
|
|
//!
|
|
//! println!("{:?}", info);
|
|
//! ```
|
|
//!
|
|
//! ## Get Client RateLimit
|
|
//! ```ignore
|
|
//! let info = client.rate_limit.await?;
|
|
//!
|
|
//! println!("{:?}", info);
|
|
//! ```
|
|
|
|
mod api;
|
|
|
|
pub use api::*;
|