1use ip_allocator_client::Client;
2
3#[tokio::main]
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let client = Client::new("http://localhost:8000");
7
8 println!("š Borrowing an item...");
10 let borrow_result = client.handlers_ip_borrow(None).await?;
13 println!("ā
Borrowed item: {:?}", borrow_result.item);
14 println!("šļø Borrow token: {}", borrow_result.borrow_token);
15
16 println!("\nš Returning the item...");
18 let return_input = ip_allocator_client::types::ReturnInput {
19 item: borrow_result.item.clone(),
20 borrow_token: borrow_result.borrow_token.clone(),
21 };
22 let return_result = client.handlers_ip_return_item(&return_input).await?;
23 println!("ā
Return operation initiated: {:?}", return_result);
24
25 println!("\nš Checking operation status...");
27 let status = client
28 .handlers_ip_get_operation_status(&return_result.operation_id)
29 .await?;
30 println!("ā
Operation status: {:?}", status);
31
32 Ok(())
33}