-
Notifications
You must be signed in to change notification settings - Fork 49
Question: Correct use of type alias? #50
Copy link
Copy link
Open
Description
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....
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels