Trait holochain::conductor::api::InterfaceApi
source · pub trait InterfaceApi: 'static + Send + Sync + Clone {
type ApiRequest: TryFrom<SerializedBytes, Error = SerializedBytesError> + Send + Sync;
type ApiResponse: TryInto<SerializedBytes, Error = SerializedBytesError> + Send + Sync;
// 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§
sourcetype ApiRequest: TryFrom<SerializedBytes, Error = SerializedBytesError> + Send + Sync
type ApiRequest: TryFrom<SerializedBytes, Error = SerializedBytesError> + Send + Sync
Which request is being made
sourcetype ApiResponse: TryInto<SerializedBytes, Error = SerializedBytesError> + Send + Sync
type ApiResponse: TryInto<SerializedBytes, Error = SerializedBytesError> + Send + Sync
Which response is sent to the above request
Required Methods§
sourcefn 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,
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