Skip to main content

get_entry

Function get_entry 

Source
pub async fn get_entry(entry_struct: &GetEntry) -> Result<Response, Error>
Expand description

Returns the value associated with an entry.

Examples found in repository?
examples/get-entry.rs (line 23)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8    let api_key = "API_KEY".to_string();
9    let universe_id: u64 = 0;
10
11    let datastore_name: String = "DATASTORE_NAME".to_string();
12    let key: String = "ENTRY_KEY".to_string();
13    let scope: Option<String> = None; // None = default to global
14
15    let entry_struct = GetEntry {
16        api_key,
17        universe_id,
18        datastore_name,
19        key,
20        scope,
21    };
22
23    let res: Response = get_entry(&entry_struct).await?;
24
25    let body = res.text().await?;
26    println!("{}", body);
27
28    Ok(())
29}