pub trait RedeemRequestRepository {
type Utxo: IUtxo;
type Iter: Iterator<Item = (CorrelationId, RedeemRequestRecord<Self::Utxo>)>;
// Required methods
fn get_unfulfilled_redeem_request(
&self,
correlation_id: CorrelationId,
) -> Option<RedeemRequestRecord<Self::Utxo>>;
fn store_redeem_request(
&self,
correlation_id: CorrelationId,
record: RedeemRequestRecord<Self::Utxo>,
);
fn remove_redeem_request(&self, correlation_id: CorrelationId);
fn all_unfulfilled_redeem_requests(&self) -> Self::Iter;
}Expand description
Provides access to and storage of info in the ledger about pending unfulfilled redeem requests in the form of RedeemRequestRecords
Required Associated Types§
type Utxo: IUtxo
Sourcetype Iter: Iterator<Item = (CorrelationId, RedeemRequestRecord<Self::Utxo>)>
type Iter: Iterator<Item = (CorrelationId, RedeemRequestRecord<Self::Utxo>)>
The type of iterator the implementor uses
Required Methods§
Sourcefn get_unfulfilled_redeem_request(
&self,
correlation_id: CorrelationId,
) -> Option<RedeemRequestRecord<Self::Utxo>>
fn get_unfulfilled_redeem_request( &self, correlation_id: CorrelationId, ) -> Option<RedeemRequestRecord<Self::Utxo>>
Fetches the redeem request record for the correlation id if one exists
Sourcefn store_redeem_request(
&self,
correlation_id: CorrelationId,
record: RedeemRequestRecord<Self::Utxo>,
)
fn store_redeem_request( &self, correlation_id: CorrelationId, record: RedeemRequestRecord<Self::Utxo>, )
Stores a new unfulfilled redeem request record under the provided correlation id
Sourcefn remove_redeem_request(&self, correlation_id: CorrelationId)
fn remove_redeem_request(&self, correlation_id: CorrelationId)
Remove an unfulfilled redeem request record from storage - either because of fulfillment or cancellation.
Sourcefn all_unfulfilled_redeem_requests(&self) -> Self::Iter
fn all_unfulfilled_redeem_requests(&self) -> Self::Iter
Returns an iterator over all outstanding unfulfilled redeem requests