Trait specifications::driving::DriverService
source · pub trait DriverService:
'static
+ Send
+ Sync {
type ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>;
// Required methods
fn create_session<'life0, 'async_trait>(
&'life0 self,
request: Request<CreateSessionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CreateSessionReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The DriverService, which is a trait for easily writing a service for the driver communication protocol.
Implementation based on the auto-generated version from tonic.
Required Associated Types§
sourcetype ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>
type ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>
The response type for stream returned by DriverService::execute()
.
Required Methods§
sourcefn create_session<'life0, 'async_trait>(
&'life0 self,
request: Request<CreateSessionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CreateSessionReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_session<'life0, 'async_trait>(
&'life0 self,
request: Request<CreateSessionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CreateSessionReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when a CreateSessionRequest comes in.
§Arguments
request
: The (tonic::Request
-wrapped) CreateSessionRequest containing the relevant details.
§Returns
A CreateSessionReply for this request, wrapped in a tonic::Response
.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.
sourcefn check<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when a CheckRequest
comes in.
§Arguments
request
: The (tonic::Request
-wrapped)CheckRequest
containing the relevant details.
§Returns
A CheckReply
for this request, wrapped in a tonic::Response
.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.
sourcefn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when an ExecuteRequest comes in.
§Arguments
request
: The (tonic::Request
-wrapped) ExecuteRequest containing the relevant details.
§Returns
A stream of ExecuteReply messages, updating the client and eventually sending back the workflow result.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.