#[derive(Debug, Clone, Default)]
pub struct CostPaymentStack {
stack: Vec<CostPaymentEntry>,
}
#[derive(Debug, Clone)]
pub struct CostPaymentEntry {
pub cost_description: String,
}
impl CostPaymentStack {
pub fn new() -> Self {
CostPaymentStack { stack: Vec::new() }
}
pub fn push(&mut self, entry: CostPaymentEntry) {
self.stack.push(entry);
}
pub fn pop(&mut self) -> Option<CostPaymentEntry> {
self.stack.pop()
}
pub fn peek(&self) -> Option<&CostPaymentEntry> {
self.stack.last()
}
pub fn clear(&mut self) {
self.stack.clear();
}
pub fn iter(&self) -> impl Iterator<Item = &CostPaymentEntry> {
self.stack.iter()
}
pub fn iterator(&self) -> impl Iterator<Item = &CostPaymentEntry> {
self.stack.iter()
}
}