-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bwavfile::raw_chunk_reader is a private module #6
Comments
It's okay this is my first Rust project too! I don't think you need to have that use statement in your main. Just remove it and it should compile fine, all you need is Look at the integration tests and see its pattern of uses, it does this same operation in |
Actually looking at this maybe I need to rewrite the The OTHER thing you can try for now is write the function signature like this: fn from_wav_filename<T>(wav_filename: &str) -> Result<(WaveFmt, AudioFrameReader<T>), ()>
where T: io::Read+io::Seek { /* yada yada yada */} |
Thanks for your help, btw this lib looks very good, it's already been useful for me. I've tried adding the generic type, the compiler complains I think because in this case the return type can only be one thing i.e. since I'm returning the type returned from
I guess instead of the |
So in 09a9413 on master I've changed the interface so this function would work more like... fn from_wav_filename(wav_filename: &str) -> Result<(WaveFmt, AudioFrameReader<std::fs::File>), ()> { } However you will have to rejigger your function a bit because the |
In the future I might revisit this and have |
FYI this is implemented in master at 8985361 so your function should work now as you wrote it. Thanks for the good note, I've been having trouble understanding why you unwrap inner fields on structs in Rust and this was a great example! |
I'm very new to Rust so I may be doing something wrong - I'm trying to write a function that returns an
AudioFrameReader
, this is the function:However, compilation fails because bwavfile::raw_chunk_reader is a private module:
It seems like I'd run into the same issue if I tried adding AudioFrameReader to a custom struct type.
The text was updated successfully, but these errors were encountered: