pub trait Client<T>
where Self: Sized + Client<T> + ClientConnect<T>, T: Send + Clone,
{ type ReadyRequest; type ReadyResponse; // Required methods fn is_ready<'life0, 'async_trait>( &'life0 self, request: Self::ReadyRequest ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ReadyResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn query_flight<'life0, 'async_trait>( &'life0 self, request: QueryFlightRequest ) -> Pin<Box<dyn Future<Output = Result<Response<QueryFlightResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_itinerary<'life0, 'async_trait>( &'life0 self, request: CreateItineraryRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cancel_itinerary<'life0, 'async_trait>( &'life0 self, request: CancelItineraryRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cancel_task<'life0, 'async_trait>( &'life0 self, request: TaskRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_task_status<'life0, 'async_trait>( &'life0 self, request: TaskRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

gRPC object traits to provide wrappers for grpc functions

Required Associated Types§

source

type ReadyRequest

The type expected for ReadyRequest structs.

source

type ReadyResponse

The type expected for ReadyResponse structs.

Required Methods§

source

fn is_ready<'life0, 'async_trait>( &'life0 self, request: Self::ReadyRequest ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ReadyResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a tonic::Response containing a ReadyResponse Takes an ReadyRequest.

Errors

Returns tonic::Status with tonic::Code::Unknown if the server is not ready.

Examples
use lib_common::grpc::get_endpoint_from_env;
use scheduler::{ReadyRequest, SchedulerClient};
use svc_scheduler_client_grpc::prelude::*;

async fn example () -> Result<(), Box<dyn std::error::Error>> {
    let (host, port) = get_endpoint_from_env("SERVER_HOSTNAME", "SERVER_PORT_GRPC");
    let connection = SchedulerClient::new_client(&host, port, "scheduler");
    let response = connection
        .is_ready(ReadyRequest {})
        .await?;
    println!("RESPONSE={:?}", response.into_inner());
    Ok(())
}
source

fn query_flight<'life0, 'async_trait>( &'life0 self, request: QueryFlightRequest ) -> Pin<Box<dyn Future<Output = Result<Response<QueryFlightResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

wrapper

source

fn create_itinerary<'life0, 'async_trait>( &'life0 self, request: CreateItineraryRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

wrapper

source

fn cancel_itinerary<'life0, 'async_trait>( &'life0 self, request: CancelItineraryRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

wrapper

source

fn cancel_task<'life0, 'async_trait>( &'life0 self, request: TaskRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

wrapper

source

fn get_task_status<'life0, 'async_trait>( &'life0 self, request: TaskRequest ) -> Pin<Box<dyn Future<Output = Result<Response<TaskResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

wrapper

Object Safety§

This trait is not object safe.

Implementors§