aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Example of reading a fixed string #170

Closed lukesneeringer closed 3 years ago

lukesneeringer commented 3 years ago

I can not for the life of me figure out how to do this, and I have read a decent amount of the source code and tests.

I think it should be:

use hdf5;
use hdf5::types::FixedAscii;

#[derive(Clone, Debug, hdf5::H5Type, PartialEq)]
#[repr(C)]
struct Foo {
  bar: FixedAscii<10>,
}

This gives a compiler error: constant provided when a type was expected.

It would be really nice to have an example.

lukesneeringer commented 3 years ago

I figured this out. It turns out the main branch has diverged significantly from the previous release, and my code is correct there.

It would be awesome if this could be released. :)

aldanor commented 3 years ago

Closed in #179