stock-trek 0.4.1

Stock Trek time-series analysis
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Error, Debug)]
#[non_exhaustive]
#[repr(u8)]
pub enum PortfolioError {
    #[error("Portfolio has no account in {exchange}")]
    NoAccountInExchange { exchange: String },
    #[error("Portfolio does not own any {asset} in {exchange}")]
    AssetNotOwned { exchange: String, asset: String },
    #[error("Portfolio has {tokens} {asset} in {exchange} and cannot remove {remove_request}")]
    NotEnoughTokens {
        exchange: String,
        asset: String,
        tokens: f64,
        remove_request: f64,
    },
}