Skip to content
Discussion options

You must be logged in to vote

Hi, thanks for your question!

There is no way to apply directives to the inner type of a container. Instead, read a whole collection of Vec<u8> and then use the map directive to convert the collection into a Vec<f32> by c.into_iter().map(|v| …).collect(). Alternatively, if you need to avoid the memory overhead of temporarily holding two copies of the data, you can also write custom parse_with/write_with functions (the parser and writer macros help with this).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nenikitov
Comment options

Answer selected by nenikitov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants