You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have a file where one dataset is stored as a VarLenArray of a custom compound which contains at least one VarLenArray. The following code does not work with the current version as the trait Copy is not implemented for VarLenArray
#[derive(H5Type,Copy,Debug)]// register with HDF5#[repr(C)]pubstructCluster{id:i32,name:VarLenAscii,colour:i32,neighbours:VarLenArray<i32>,}fnread_clusters(dataset:Dataset) -> Result<()>{let clusters:VarLenArray<Cluster> = dataset.read_scalar()?;println!("{:?}", clusters);// ... process clusters ...Ok(())}
Results in the error:
error[E0204]: the trait `Copy` may not be implemented for this type
--> src\main.rs:60:18
|
60 | #[derive(H5Type, Copy, Debug)] // register with HDF5
| ^^^^
...
63 | name: VarLenAscii,
| ----------------- this field does not implement `Copy`
...
67 | neighbours: VarLenArray<i32>,
| -------------------------- this field does not implement `Copy`
If I change VarLenArray to requiring Clone instead of Copy then I can get this to compile, run and read in the correct data, but I am unsure what effects that has on the code. What would be a good solution to this problem?
The text was updated successfully, but these errors were encountered:
Hello,
I have a file where one dataset is stored as a
VarLenArray
of a custom compound which contains at least oneVarLenArray
. The following code does not work with the current version as the traitCopy
is not implemented forVarLenArray
Results in the error:
If I change
VarLenArray
to requiringClone
instead ofCopy
then I can get this to compile, run and read in the correct data, but I am unsure what effects that has on the code. What would be a good solution to this problem?The text was updated successfully, but these errors were encountered: