Skip to main content

implement

Function implement 

Source
pub fn implement<TBaseCtx: Context, TInput, TOutput, TError>(
    contract: ContractProcedure<TInput, TOutput, TError>,
) -> ContractImplementer<TBaseCtx, TInput, TOutput, TError>
where TError: Into<ProcedureError> + Send + 'static,
Expand description

Create a ContractImplementer from a contract, bound to a specific base context type.

The returned implementer constrains the handler’s input/output types to match the contract.

let proc = implement::<AppCtx, _, _, _>(contract)
    .handler(get_user_handler);
// Compiler enforces: handler must be Fn(AppCtx, GetUserInput) -> Result<User, ORPCError>