pub struct VecStat<'a> { base: &'a Vec, more: i32, } impl<'a> VecStat<'a> { pub fn new(base: &'a Vec) -> Self { Self { base, more: 0 } } pub fn base(&'a self) -> &'a Vec { self.base } pub fn more(&mut self, value: i32) { self.more = value } pub fn summary(&self) -> i32 { self.base.iter().sum::() + self.more } }