pub async fn list_projects(
client: &mut NlpClient,
request: Option<GetProjectsRequest>,
) -> Result<Vec<Project>, Box<dyn Error>>Expand description
Gets the projects available on the server.
§Arguments
client- The client to use to communicate with the server.request- The request to send to the server. If None is given, the default request will be used.
§Example
use aristech_nlp_client::{get_client, list_projects, TlsOptions};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut client = get_client("https://nlp.example.com".to_string(), Some(TlsOptions::default())).await?;
let projects = list_projects(&mut client, None).await?;
for project in projects {
println!("{:?}", project);
}
Ok(())
}