pub struct TaxConfig {
pub jurisdiction: String,
pub long_term_threshold_days: i64,
pub short_term_rate: Decimal,
pub long_term_brackets: Vec<TaxBracket>,
}Expand description
Tax-rate configuration: a flat short-term rate plus progressive long-term brackets, with a configurable long-term holding threshold.
§Example
use coinbasis::TaxConfig;
let c = TaxConfig::default();
assert_eq!(c.long_term_threshold_days, 365);Fields§
§jurisdiction: StringDisplay label for the jurisdiction (does not affect the math).
long_term_threshold_days: i64Days held strictly above which a gain is long-term.
short_term_rate: DecimalFlat rate applied to net short-term gains.
long_term_brackets: Vec<TaxBracket>Progressive long-term brackets, ascending, unbounded bracket last.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaxConfig
impl<'de> Deserialize<'de> for TaxConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TaxConfig
Auto Trait Implementations§
impl Freeze for TaxConfig
impl RefUnwindSafe for TaxConfig
impl Send for TaxConfig
impl Sync for TaxConfig
impl Unpin for TaxConfig
impl UnsafeUnpin for TaxConfig
impl UnwindSafe for TaxConfig
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