pub trait PercentCalculus<Rhs = Self> {
// Required methods
fn addpercent(self, rhs: Rhs) -> Self;
fn subpercent(self, rhs: Rhs) -> Self;
fn how_many(self, percent: Self) -> Self;
fn change(self, new: Self) -> Self;
}Expand description
Trait for performing percentage-based calculations.
This trait provides methods to add, subtract, and calculate percentages for numeric types, enabling common financial calculations.
Required Methods§
Sourcefn addpercent(self, rhs: Rhs) -> Self
fn addpercent(self, rhs: Rhs) -> Self
Sourcefn subpercent(self, rhs: Rhs) -> Self
fn subpercent(self, rhs: Rhs) -> Self
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.