Module queue_times::client[][src]

Expand description

Contains implementations of reqwest based clients for parsing queue times.

Almost all use cases will want to use CachedClient like so:

use queue_times::client::{Client, QueueTimesClient, CachedClient};

let client = CachedClient::default(); //Replace with `Client::new()` to remove caching if needed
let parks = client.get_park_urls().await?;
let cedar_point_waits = client.get_ride_times(parks.get("Cedar Point")?.to_owned()).await?;

let mille_wait = cedar_point_waits.iter().find(|r| r.name == "Millennium Force").unwrap();

println!("The current wait for Millennium Force is: {:?}", mille_wait.status)

All clients use Tokio async, and are thread-safe.

Traits in this module use [async_trait] to achive the obvious. Because of this however, function signatures can become quite mangeled. It may be worth looking at the source code for QueueTimesClient if the signatures don’t seem obvious.

Structs

CachedClient

Thread-safe cache wrapper for a QueueTimesClient.

Client

Provides a queue times client that uses the generic parser without caching.

Statics

BASE_URL

Base Url to the queue times website.

Traits

QueueTimesClient

Defines the public interface of a queue times client.