Expand description
§WaitHuman Rust Client
A Rust client library for interacting with the WaitHuman API.
WaitHuman enables applications to pause execution and request human input or confirmation on demand. This client provides a simple, ergonomic API for creating confirmation requests and waiting for human responses.
§Features
- Async API: Built on tokio for efficient async I/O
- Type-safe: Leverages Rust’s type system for compile-time safety
- Multiple answer formats: Support for free text and multiple choice questions
- Configurable timeouts: Optional timeout support for all requests
§Example
use wait_human::WaitHuman;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new client
let client = WaitHuman::new_from_key("your-api-key")?;
// Ask a free-text question
let answer = client.ask_free_text(
"What is your name?",
None::<&str>,
None,
).await?;
println!("Answer: {}", answer);
// Ask a multiple-choice question
let choice = client.ask_multiple_choice(
"Select an option",
["Option 1", "Option 2"],
None::<&str>,
None,
).await?;
println!("Selected: {}", choice);
Ok(())
}Structs§
- AskOptions
- Options for ask requests
- Confirmation
Answer - The structure stored in DB for answers
- Confirmation
Answer With Date - Confirmation
Question - The structure stored in DB for question
- Wait
Human - Main WaitHuman client for making requests
- Wait
Human Config - Configuration for the WaitHuman client
Enums§
- Answer
Content - Answer
Format - Question
Method - Wait
Human Error - Errors that can occur when using the WaitHuman client
Type Aliases§
- Result
- Result type alias for WaitHuman operations