What is the mpsc channel equivalent where past messages are kicked out when the bound is hit and only the most recently sent message is sent to the receiver? mpsc sends all the messages but I just want a bounded channel that sends holds one message and sends it over when requested. it should discard the previous messages when a new one is sent.
Something like this:
let (sender, receiver) = channel(1);
sender.send("One").unwrap();
sender.send("Two").unwrap();
let message = receiver.recv().unwrap();
println!("{message}"); // Output: "Two"