Trait fedimint_core::module::TypedApiEndpoint

source ·
pub trait TypedApiEndpoint {
    type State: Sync;
    type Param: DeserializeOwned + Send;
    type Response: Serialize;

    const PATH: &'static str;

    // Required method
    fn handle<'state, 'context, 'dbtx, 'async_trait>(
        state: &'state Self::State,
        context: &'context mut ApiEndpointContext<'dbtx>,
        request: Self::Param,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Response, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'dbtx: 'context + 'async_trait,
             'state: 'async_trait,
             'context: 'async_trait;
}

Required Associated Types§

Required Associated Constants§

source

const PATH: &'static str

example: /transaction

Required Methods§

source

fn handle<'state, 'context, 'dbtx, 'async_trait>( state: &'state Self::State, context: &'context mut ApiEndpointContext<'dbtx>, request: Self::Param, ) -> Pin<Box<dyn Future<Output = Result<Self::Response, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'dbtx: 'context + 'async_trait, 'state: 'async_trait, 'context: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§