I'm trying to define a trait in a class that needs to be copyable. This seems fine to me but the compiler is not happy. I can't seem to find documentation or discussions on my issue - any help would be appreciated!
#[derive(Clone, Copy, Debug)]
pub struct Buffer {
stream: Stream
}
pub trait Stream: Copy + Clone {
fn next(&self) -> Stream;
}
error[E0204]: the trait
Copy
may not be implemented for this type
--> src/pieces/mod.rs:30:17
|
| #[derive(Clone, Copy, Debug)]
| ^^^^
...
| generator: TetrominoStream
| -------------------------- this field does not implementCopy
Thank you