pub trait OrderManager {
    type Error;
    type InvestmentId;
    type Orders;
    type Fulfillment;

    // Required methods
    fn invest_orders(asset_id: Self::InvestmentId) -> Self::Orders;
    fn redeem_orders(asset_id: Self::InvestmentId) -> Self::Orders;
    fn process_invest_orders(
        asset_id: Self::InvestmentId
    ) -> Result<Self::Orders, Self::Error>;
    fn process_redeem_orders(
        asset_id: Self::InvestmentId
    ) -> Result<Self::Orders, Self::Error>;
    fn invest_fulfillment(
        asset_id: Self::InvestmentId,
        fulfillment: Self::Fulfillment
    ) -> Result<(), Self::Error>;
    fn redeem_fulfillment(
        asset_id: Self::InvestmentId,
        fulfillment: Self::Fulfillment
    ) -> Result<(), Self::Error>;
}
Expand description

A trait, when implemented must take care of collecting orders (invest & redeem) for a given investment class. When being asked it must return the current orders and when being singled about a fulfillment, it must act accordingly.

Required Associated Types§

Required Methods§

source

fn invest_orders(asset_id: Self::InvestmentId) -> Self::Orders

When called the manager return the current invest orders for the given investment class.

source

fn redeem_orders(asset_id: Self::InvestmentId) -> Self::Orders

When called the manager return the current redeem orders for the given investment class.

source

fn process_invest_orders( asset_id: Self::InvestmentId ) -> Result<Self::Orders, Self::Error>

When called the manager return the current invest orders for the given investment class. Callers of this method can expect that the returned orders equal the returned orders from invest_orders.

NOTE: Once this is called, the OrderManager is expected to start a new round of orders and return an error if this method is to be called again before invest_fulfillment is called.

source

fn process_redeem_orders( asset_id: Self::InvestmentId ) -> Result<Self::Orders, Self::Error>

When called the manager return the current invest orders for the given investment class. Callers of this method can expect that the returned orders equal the returned orders from redeem_orders.

NOTE: Once this is called, the OrderManager is expected to start a new round of orders and return an error if this method is to be called again before redeem_fulfillment is called.

source

fn invest_fulfillment( asset_id: Self::InvestmentId, fulfillment: Self::Fulfillment ) -> Result<(), Self::Error>

Signals the manager that the previously fetch invest orders for a given investment class will be fulfilled by fulfillment.

source

fn redeem_fulfillment( asset_id: Self::InvestmentId, fulfillment: Self::Fulfillment ) -> Result<(), Self::Error>

Signals the manager that the previously fetch redeem orders for a given investment class will be fulfilled by fulfillment.

Object Safety§

This trait is not object safe.

Implementors§