Trait holochain::conductor::api::AdminInterfaceApi
source · pub trait AdminInterfaceApi: 'static + Send + Sync + Clone {
fn handle_admin_request_inner<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = ConductorApiResult<AdminResponse>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn handle_admin_request<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = AdminResponse> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait,
{ ... }
}
Expand description
A trait for the interface that a Conductor exposes to the outside world to use for administering the conductor. This trait has one mock implementation and one “real” implementation
Required Methods§
sourcefn handle_admin_request_inner<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = ConductorApiResult<AdminResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_admin_request_inner<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = ConductorApiResult<AdminResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Call an admin function to modify this Conductor’s behavior
Provided Methods§
sourcefn handle_admin_request<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = AdminResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_admin_request<'life0, 'async_trait>(
&'life0 self,
request: AdminRequest
) -> Pin<Box<dyn Future<Output = AdminResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deal with error cases produced by handle_admin_request_inner
Examples found in repository?
src/conductor/api/api_external/admin_interface.rs (line 315)
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
async fn handle_request(
&self,
request: Result<Self::ApiRequest, SerializedBytesError>,
) -> InterfaceResult<Self::ApiResponse> {
// Don't hold the read across both awaits
{
self.conductor_handle
.check_running()
.map_err(Box::new)
.map_err(InterfaceError::RequestHandler)?;
}
match request {
Ok(request) => Ok(AdminInterfaceApi::handle_admin_request(self, request).await),
Err(e) => Ok(AdminResponse::Error(SerializationError::from(e).into())),
}
}