Skip to navigation
Create a JSON file object, stringify it and save it to a file in rust
20.09.22
use async_std::fs; let mut data = json::JsonValue::new_object(); data["access_token"] = "xxxx".into(); data["refresh_token"] = "xxxx".into(); data["expires_in"] = "xxxx".into(); data["expires_at"] = "xxxx".into(); data["token_type"] = "xxxx".into(); let jtoken = data.dump(); fs::write("a.txt", jtoken).await;
https://docs.rs/async-std/1.12.0/async_std/fs/fn.write.html
Reply
Anonymous
Information Epoch 1742418044
Avoid captive user interfaces.
Home
Notebook
Contact us