pub struct PortfolioManager { /* private fields */ }Expand description
Portfolio manager for investment portfolio management
Implementations§
Source§impl PortfolioManager
impl PortfolioManager
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), FinancialError>
pub fn validate_portfolio( &self, portfolio: &Portfolio, ) -> Result<(), FinancialError>
pub fn create_portfolio( &mut self, portfolio: Portfolio, ) -> Result<Portfolio, FinancialError>
pub fn get_portfolio( &self, portfolio_id: &str, ) -> Result<Portfolio, FinancialError>
pub fn list_portfolios(&self) -> Vec<String>
pub fn get_performance_metrics(&self) -> FinancialPerformanceMetrics
Sourcepub fn register_rebalancing_strategy(&mut self, strategy: RebalancingStrategy)
pub fn register_rebalancing_strategy(&mut self, strategy: RebalancingStrategy)
Register a rebalancing strategy with the underlying engine (keyed by
strategy.strategy_id) so rebalance_portfolio can use it.
Sourcepub fn rebalance_portfolio(
&self,
portfolio_id: &str,
) -> Result<Vec<RebalanceTrade>, FinancialError>
pub fn rebalance_portfolio( &self, portfolio_id: &str, ) -> Result<Vec<RebalanceTrade>, FinancialError>
Public rebalancing API: look up the portfolio, compute drift against a
registered strategy (or a default strategy when none is registered for
the default id), and return the proposed RebalanceTrades. The portfolio
is not mutated — trades are proposals for the execution layer.
Auto Trait Implementations§
impl !Freeze for PortfolioManager
impl RefUnwindSafe for PortfolioManager
impl Send for PortfolioManager
impl Sync for PortfolioManager
impl Unpin for PortfolioManager
impl UnsafeUnpin for PortfolioManager
impl UnwindSafe for PortfolioManager
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more