[][src]Trait interledger_settlement::IdempotentStore

pub trait IdempotentStore {
    fn load_idempotent_data(
        &self,
        idempotency_key: String
    ) -> Box<dyn Future<Item = Option<IdempotentData>, Error = ()> + Send>;
fn save_idempotent_data(
        &self,
        idempotency_key: String,
        input_hash: [u8; 32],
        status_code: StatusCode,
        data: Bytes
    ) -> Box<dyn Future<Item = (), Error = ()> + Send>; }

Required methods

fn load_idempotent_data(
    &self,
    idempotency_key: String
) -> Box<dyn Future<Item = Option<IdempotentData>, Error = ()> + Send>

Returns the API response that was saved when the idempotency key was used Also returns a hash of the input data which resulted in the response

fn save_idempotent_data(
    &self,
    idempotency_key: String,
    input_hash: [u8; 32],
    status_code: StatusCode,
    data: Bytes
) -> Box<dyn Future<Item = (), Error = ()> + Send>

Saves the data that was passed along with the api request for later The store MUST also save a hash of the input, so that it errors out on requests

Loading content...

Implementors

Loading content...