//! Gets the descriptive information of the execution service. //! //! You can run this with the following command: //! //! `TOKEN= RUST_LOG=tes=debug cargo run --release --features=client //! --example service-info ` use anyhow::Context; use anyhow::Result; use tes::v1::client; use tracing_subscriber::EnvFilter; #[tokio::main] async fn main() -> Result<()> { tracing_subscriber::fmt() .with_env_filter(EnvFilter::from_default_env()) .init(); let url = std::env::args().nth(1).expect("url to be present"); let mut builder = client::Builder::default() .url_from_string(url) .expect("url could not be parsed"); if let Ok(token) = std::env::var("TOKEN") { builder = builder.insert_header("Authorization", format!("Basic {}", token)); } let client = builder.try_build().expect("could not build client"); println!( "{:#?}", client .service_info() .await .context("getting the service information")? ); Ok(()) }