pub fn debit(&mut self, amount: f64) -> Result<()> {
        if amount > self.available_balance {
            return Err(Error::InssuficientFunds);
        }
        self.available_balance -= amount;
        self.total_balance -= amount;
        Ok(())
    }
/// Take away from the client's balance
/// This function updates the client's available and total balance
///
/// # Note
/// This function does prevent debiting more than the available balance
Take away from the client's balance
This function updates the client's available and total balance
Take away from the client ' s balance This function updates the client ' s available and total balance
pub fn debit(&mut self, amount: f64) -> Result<()> {
        if amount > self.available_balance {
            return Err(Error::InssuficientFunds);
        }
        self.available_balance -= amount;
        self.total_balance -= amount;
        Ok(())
    }
pub fn debit ( & mut self , amount : f64 ) -> Result < ( ) > { if amount > self . available_balance { return Err ( Error :: InssuficientFunds ) ; } self . available_balance -= amount ; self . total_balance -= amount ; Ok ( ( ) ) }
Take away from the client's balance
This function updates the client's available and total balance
Take away from the client ' s balance This function updates the client ' s available and total balance
&mut self
amount
f64
&mut self
amount
f64
note
This function does prevent debiting more than the available balance
This function does prevent debiting more than the available balance