Cascading Style Sheets (CSS)
Some of the most useful CSS tricks to help you in a bind.
Generates a UUID. Version 4.
use uuid::Uuid;
let sessionid = Uuid::new_v4();
Make a JSON REST request. Requires reqwest.
reqwest = { version = "0.11", features = ["blocking", "json"] }use reqwest;
use std::collections::HashMap;
#[tokio::main]
pub async fn get() -> Result<HashMap<String, String>, Box<dyn std::error::Error>> {
let resp = reqwest::get("https://httpbin.org/ip")
.await?
.json::<HashMap<String, String>>()
.await?;
// println!("{:#?}\n", resp);
Ok(resp)
}