1use std::error::Error;
6
7fn main() -> Result<(), Box<dyn Error>> {
8 use raystack_blocking::{SkySparkClient, ValueExt};
9 use url::Url;
10
11 let url = Url::parse("https://www.example.com/api/projName/")?;
12
13 let mut client = SkySparkClient::new(url, "username", "p4ssw0rd")?;
17
18 let sites_grid = client.eval("readAll(site)")?;
19
20 println!("{}", sites_grid.to_json_string_pretty());
22
23 println!("All columns: {:?}", sites_grid.cols());
25 println!(
26 "first site id: {:?}",
27 sites_grid.rows()[0]["id"].as_hs_ref().unwrap()
28 );
29
30 Ok(())
31}