list_functions

Function list_functions 

Source
pub async fn list_functions(
    client: &mut NlpClient,
    request: Option<FunctionRequest>,
) -> Result<Vec<Function>, Box<dyn Error>>
Expand description

Gets the functions 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_functions, 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 functions = list_functions(&mut client, None).await?;
    for function in functions {
        println!("{:?}", function);
    }
    Ok(())
}