There are type alias for producers and consumbers, namely Prod and Cons that depend on the storage used.
If I try and put those type alises into a structure I need to define the type, but I have no idea what that type should be.
e.g.
use ringbuf::{traits::*, HeapRb, Prod, Cons};
pub struct SerialBuffer {
fifo: HeapRb<u8>,
prod: Prod<P>.
cons: Cons<C>
}
impl Default for SerialBuffer {
fn default() -> Self {
let mut fifo = HeapRb::<u8>:new(100);
let (mut prod, mut cons) = fifo.split();
Self {
fifo: fifo,
prod: prod,
cons: cons
}
}
}
What are the types for P and C?
I've tried the obvious u8 and Arc<u8> but neither are accepted. I've looked through the code and examples with no luck....
There are type alias for producers and consumbers, namely
ProdandConsthat depend on the storage used.If I try and put those type alises into a structure I need to define the type, but I have no idea what that type should be.
e.g.
What are the types for
PandC?I've tried the obvious
u8andArc<u8>but neither are accepted. I've looked through the code and examples with no luck....