pub struct PortfolioContext(/* private fields */);Expand description
Portfolio analytics context — exchange rates, P&L analysis.
Implementations§
Source§impl PortfolioContext
impl PortfolioContext
Sourcepub fn new(config: Arc<Config>) -> Self
pub fn new(config: Arc<Config>) -> Self
Create a PortfolioContext
Sourcepub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
pub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
Returns the log subscriber
Sourcepub async fn exchange_rate(&self) -> Result<ExchangeRates>
pub async fn exchange_rate(&self) -> Result<ExchangeRates>
Get exchange rates for supported currencies.
Path: GET /v1/asset/exchange_rates
Sourcepub async fn profit_analysis(
&self,
start: Option<String>,
end: Option<String>,
) -> Result<ProfitAnalysis>
pub async fn profit_analysis( &self, start: Option<String>, end: Option<String>, ) -> Result<ProfitAnalysis>
Get portfolio P&L analysis (summary + per-security breakdown).
Combines GET /v1/portfolio/profit-analysis-summary and
GET /v1/portfolio/profit-analysis-sublist concurrently.
Sourcepub async fn profit_analysis_by_market(
&self,
market: Option<String>,
start: Option<String>,
end: Option<String>,
currency: Option<String>,
page: u32,
size: u32,
) -> Result<ProfitAnalysisByMarket>
pub async fn profit_analysis_by_market( &self, market: Option<String>, start: Option<String>, end: Option<String>, currency: Option<String>, page: u32, size: u32, ) -> Result<ProfitAnalysisByMarket>
Get paginated P&L analysis filtered by market.
Path: GET /v1/portfolio/profit-analysis/by-market
Sourcepub async fn profit_analysis_detail(
&self,
symbol: impl Into<String>,
start: Option<String>,
end: Option<String>,
) -> Result<ProfitAnalysisDetail>
pub async fn profit_analysis_detail( &self, symbol: impl Into<String>, start: Option<String>, end: Option<String>, ) -> Result<ProfitAnalysisDetail>
Get P&L detail for a specific security.
Path: GET /v1/portfolio/profit-analysis/detail
Trait Implementations§
Source§impl Clone for PortfolioContext
impl Clone for PortfolioContext
Source§fn clone(&self) -> PortfolioContext
fn clone(&self) -> PortfolioContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PortfolioContext
impl !RefUnwindSafe for PortfolioContext
impl Send for PortfolioContext
impl Sync for PortfolioContext
impl Unpin for PortfolioContext
impl UnsafeUnpin for PortfolioContext
impl !UnwindSafe for PortfolioContext
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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