Trait holochain::conductor::api::InterfaceApi

source ·
pub trait InterfaceApi: 'static + Send + Sync + Clone {
    type ApiRequest: TryFrom<SerializedBytes, Error = SerializedBytesError> + Send + Sync + Debug;
    type ApiResponse: TryInto<SerializedBytes, Error = SerializedBytesError> + Send + Sync + Debug;

    // Required method
    fn handle_request<'life0, 'async_trait>(
        &'life0 self,
        request: Result<Self::ApiRequest, SerializedBytesError>
    ) -> Pin<Box<dyn Future<Output = InterfaceResult<Self::ApiResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait that unifies both the admin and app interfaces

Required Associated Types§

source

type ApiRequest: TryFrom<SerializedBytes, Error = SerializedBytesError> + Send + Sync + Debug

Which request is being made

source

type ApiResponse: TryInto<SerializedBytes, Error = SerializedBytesError> + Send + Sync + Debug

Which response is sent to the above request

Required Methods§

source

fn handle_request<'life0, 'async_trait>( &'life0 self, request: Result<Self::ApiRequest, SerializedBytesError> ) -> Pin<Box<dyn Future<Output = InterfaceResult<Self::ApiResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a request on this API

Object Safety§

This trait is not object safe.

Implementors§