docs: fix up docs related to getting started, etc.
This commit is contained in:
parent
49605fb854
commit
99bb02f10c
2 changed files with 26 additions and 2 deletions
22
src/lib.rs
22
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<T: AsRef<str>>(api_key: T) -> Result<Self, Error> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue