Generic Stack
Create a generic struct Stack<T> with a field items: Vec<T>. Add three methods: new() that creates an empty stack, push(&mut self, item: T) that adds an item, and peek(&self) -> Option<&T> that returns the last item. Test it with integers.
Expected output:
text
Top: Some(30)
Hints:
Stack::new()returnsStack { items: Vec::new() }pushusesself.items.push(item)peekusesself.items.last()
rust
fn main() {
}