Expand description
§Norris
Simple async wrapper for the Chuck Norris Joke API.
§Usage
Example for retrieving a random joke:
use::std::error::Error;
use::norris::get_random_joke;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let joke = get_random_joke().await?.value;
println!("{}", joke);
Ok(())
}§Documentation
Please refer to docs.rs.
Structs§
- Chuck
Norris Joke - API response when requesting a joke - reduced to the joke string only
- Joke
Search Result - API response when searching by search terms - contains multiple jokes and the total amount of received jokes
Enums§
- Joke
Category - Available joke categories to search by
Functions§
- get_
random_ joke - get_
random_ joke_ by_ category - search_
for_ all_ available_ jokes - Searches for all jokes that contain the
search_string - search_
for_ one_ joke - Searches for a joke that contain the
search_string