pub trait PositionRead: StateRead {
// Provided methods
fn all_positions(
&self,
) -> Pin<Box<dyn Stream<Item = Result<Position>> + Send + 'static>> { ... }
fn positions_by_price(
&self,
pair: &DirectedTradingPair,
) -> Pin<Box<dyn Stream<Item = Result<(Id, Position)>> + Send + 'static>> { ... }
fn position_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn check_position_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn best_position<'life0, 'life1, 'async_trait>(
&'life0 self,
pair: &'life1 DirectedTradingPair,
) -> Pin<Box<dyn Future<Output = Result<Option<(Id, Position)>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn pending_position_closures(&self) -> Vector<Id> { ... }
fn candidate_set(
&self,
from: Id,
fixed_candidates: Arc<Vec<Id>>,
) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send>> { ... }
fn ordered_routable_assets(
&self,
start: &Id,
) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>> { ... }
fn recently_accessed_assets(&self) -> OrdSet<Id> { ... }
}
Available on crate feature
component
only.Provided Methods§
Sourcefn all_positions(
&self,
) -> Pin<Box<dyn Stream<Item = Result<Position>> + Send + 'static>>
fn all_positions( &self, ) -> Pin<Box<dyn Stream<Item = Result<Position>> + Send + 'static>>
Return a stream of all [position::Metadata
] available.
Sourcefn positions_by_price(
&self,
pair: &DirectedTradingPair,
) -> Pin<Box<dyn Stream<Item = Result<(Id, Position)>> + Send + 'static>>
fn positions_by_price( &self, pair: &DirectedTradingPair, ) -> Pin<Box<dyn Stream<Item = Result<(Id, Position)>> + Send + 'static>>
Returns a stream of position::Id
ordered by effective price.
fn position_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_position_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn best_position<'life0, 'life1, 'async_trait>(
&'life0 self,
pair: &'life1 DirectedTradingPair,
) -> Pin<Box<dyn Future<Output = Result<Option<(Id, Position)>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn pending_position_closures(&self) -> Vector<Id>
fn pending_position_closures(&self) -> Vector<Id>
Fetch the list of pending position closures.
Sourcefn candidate_set(
&self,
from: Id,
fixed_candidates: Arc<Vec<Id>>,
) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send>>
fn candidate_set( &self, from: Id, fixed_candidates: Arc<Vec<Id>>, ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send>>
Returns the list of candidate assets to route through for a trade from from
.
Combines a list of fixed candidates with a list of liquidity-based candidates.
This ensures that the fixed candidates are always considered, minimizing
the risk of attacks on routing.
Sourcefn ordered_routable_assets(
&self,
start: &Id,
) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>>
fn ordered_routable_assets( &self, start: &Id, ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>>
Returns a stream of asset::Id
routable from a given asset, ordered by liquidity.
Sourcefn recently_accessed_assets(&self) -> OrdSet<Id>
fn recently_accessed_assets(&self) -> OrdSet<Id>
Fetch the list of assets interacted with during this block.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.