diff --git a/Cargo.toml b/Cargo.toml index ae0745e..d31cf20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,8 @@ version = "0.1.0" edition = "2024" authors = ["Radical "] license = "MIT" +repository = "https://git.gorb.app/gorb/bunny-api-tokio" +description = "Provides access to the Bunny CDN API asynchronously using tokio." [dependencies] diff --git a/src/edge_storage.rs b/src/edge_storage.rs index b11514a..7b6d9bc 100644 --- a/src/edge_storage.rs +++ b/src/edge_storage.rs @@ -101,9 +101,11 @@ impl<'a> Storage { /// /// #[tokio::main] /// async fn main() -> Result<(), Error> { - /// let mut client = Client::new("api_key")?; + /// let mut client = Client::new("api_key").await?; /// /// client.storage.init(Endpoint::Frankfurt, "MyStorageZone"); + /// + /// Ok(()) /// } /// ``` pub fn init>(&mut self, endpoint: Endpoint, storage_zone: T) -> Result<(), Error> { @@ -130,6 +132,8 @@ impl<'a> Storage { /// /// // Will put a file in STORAGE_ZONE/images/file.png /// client.storage.upload("/images/file.png", file_bytes).await?; + /// + /// Ok(()) /// } /// ``` pub async fn upload>(&self, path: T, file: Bytes) -> Result<(), Error> { diff --git a/src/lib.rs b/src/lib.rs index 38e89f7..d6f6708 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,22 @@ //! This library provides access to the Bunny API asynchronously using tokio, it's not fully implemented but PRs are welcome. +//! +//! # Getting started +//! 1. add package to your project using cargo +//! +//! `$ cargo add bunny-api-tokio` +//! +//! 2. Start coding +//! +//! ``` +//! use bunny_api_tokio::{Client, error::Error}; +//! +//! #[tokio::main] +//! async fn main() -> Result<(), Error> { +//! let mut client = Client::new("api_key").await?; +//! +//! Ok(()) +//! } +//! ``` #![deny(missing_docs)] use std::sync::Arc; @@ -23,7 +41,9 @@ impl Client { /// /// #[tokio::main] /// async fn main() -> Result<(), Error> { - /// let mut client = Client::new("api_key")?; + /// let mut client = Client::new("api_key").await?; + /// + /// Ok(()) /// } /// ``` pub async fn new>(api_key: T) -> Result {