#Json to String Custom Asset on 0.12

2 messages · Page 1 of 1 (latest)

hollow token
#

I'm looking at the example in the src for reading a custom asset. Reader doesn't haven't any methods implemented. I feel like I'm missing something, am I supposed to impl the Reader?

I'm just trying to read the json to a string, not deserialize it etc.

error[E0599]: no method named read_to_end found for mutable reference &'a mut dyn futures_io::if_std::AsyncRead + Send + Sync + Unpin in the current scope
--> src/assets.rs:39:20
|
39 | reader.read_to_end(&mut bytes).await?;
| ^^^^^^^^^^^ method not found in &mut dyn AsyncRead + Send + Sync + Unpin

wild cargo
#

I think the part of the error right after your screenshot tells you to use bevy::asset::AsyncReadExt. It is an extension trait that adds the read_to_end method.