/// Create a new income budget item.
///
/// This type of budget entries will have a positive contribution on an overall budget.
///
/// # Parameters
/// * `name` - the name of the item.
/// * `amount` - the amount the entry contributes to an overall budget. This must always be
/// a positive number.
/// * `period` - the recurring period of how often the amount contribute to the overall budget.
///
/// # Returns
/// Always returns a valid budget item.
///
/// # Panics
/// If the amount is less than 0, the method will panic.
Create a new income budget item.
This type of budget entries will have a positive contribution on an overall budget.
Create a new income budget item . This type of budget entries will have a positive contribution on an overall budget .
pub fn with_income(name: &str, amount: f64, period: Period) -> BudgetItem {
        Self::check_amount(&amount);
        BudgetItem{
            name: name.to_owned(),
            period,
            item_type: Type::Income,
            amount
        }
    }
pub fn with_income ( name : & str , amount : f64 , period : Period ) -> BudgetItem { Self :: check_amount ( & amount ) ; BudgetItem { name : name . to_owned ( ) , period , item_type : Type :: Income , amount } }
Create a new income budget item.
Create a new income budget item .
Always returns a valid budget item.
Always returns a valid budget item .
name
&str
amount
f64
period
Period
panics
If the amount is less than 0, the method will panic.
If the amount is less than 0 the method will panic .