We have the following situation:
#[derive(Debug, Clone, PartialEq)]
pub struct Bar{
pub name: String,
pub anotherbar: Box<Option<Bar>>,
pub customenum: Option<Vec<Enum>>,
pub yesno: bool,
}
#[derive(Debug, Clone, Copy)]
pub struct foo {
pub name: String,
pub vector: Vec<bar>,
pub tuple: Vec<(u8, Bar)>,
}
and get the error message:
error[E0204]: the trait `Copy` may not be implemented for this type
--> src/types.rs:459:24
|
459 | #[derive(Debug, Clone, Copy)]
| ^^^^
460 | pub struct Deck{
461 | pub name: String,
| ---------------- this field does not implement `Copy`
462 | pub commander: Vec<Card>,
| ------------------------ this field does not implement `Copy`
463 | pub library: Vec<(u8, Card)>,
| ---------------------------- this field does not implement `Copy`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0204`.
I want to use the struct bar in a parallelization situation, where multiple requests add to the tuple field.
Can anyone help and explain?
tuplefield inBar. Perhaps you meantstruct foo. See why you cannot implementCopyon your type