7 Jan 2024 |
snover | it is currently always gated on verbose-backtrace feature, probably because i was not thinking very hard about it at the time | 05:48:10 |
๐SMG๐ | I think my confusion is why it works when I use a stable compiler if it's nightly only. Unless we're not talking about the same thing lol | 05:48:53 |
snover | well you asked how to get it from proc-macro input :-) | 05:51:24 |
snover | i assume โwhile parsing field in <source>โ is happening by the compiler diagnostics, the only one that binrw creates itself is โwhile parsing field '<field>' in <struct name>โ | 05:52:50 |
๐SMG๐ | The second point sounds like what I want. What should I look up for that? | 05:55:30 |
snover | the struct name comes from syn::DeriveInput::ident | 05:56:51 |
snover | the code to emit that message is at binrw_derive/src/binrw/codegen/read_options/struct.rs:577 | 05:57:39 |
snover | maybe the disconnect is that you actually just want to know the information at runtime? in which case, binrw_derive is just emitting ::core::line! macro | 05:58:47 |
๐SMG๐ | Yeah I just need it printed to the console at runtime rather than in the macro code itself. I'll look over that code later. Thanks. | 06:02:51 |
12 Jan 2024 |
| awesomerly joined the room. | 18:22:25 |
| awesomerly changed their display name from awesomerly#0 to awesomerly. | 18:22:26 |
awesomerly | hi smg im prolly gonna copy the methods you used made a library wrapper around binrw if that's ok | 18:22:26 |
๐SMG๐ | awesomerly | 18:26:54 |
awesomerly | nevermind i found a crate that will do what i wanted, and maybe do PRs | 18:27:26 |
awesomerly | i'm trying to parse valve bsp files | 18:27:30 |
awesomerly | * nevermind i found a crate that will do what i wanted that also uses binrw, and maybe do PRs to it if necessary | 18:27:42 |
awesomerly | i was thinking tha tlike your project i would wrap around the binrw reading and wriitng functions and implement them as traits | 18:28:08 |
awesomerly | im a noob so excuse the unclear language | 18:28:19 |
๐SMG๐ | Which project of mine are you referring to? | 18:29:26 |
๐SMG๐ | I've found that binread generally works well enough as is without needing a wrapper. Depending on the file format you may need to use something different than binwrite. | 18:32:27 |
awesomerly | https://github.com/icewind1991/vbsp | 18:33:55 |
awesomerly | here's the project i found | 18:33:59 |
awesomerly | looking at it one thing that concerns me a bit is that the example tells you to read the entire file into memory and then pass it in | 18:34:19 |
awesomerly | im sure that using BinReaderExt with some kind of a streamed thing would save on memory | 18:34:53 |
awesomerly | perhaps | 18:34:55 |
awesomerly | idk this stuff is the first real thing i'm doing with rust | 18:35:08 |
awesomerly | some maps are hundreds of megabytes at max | 18:37:12 |
awesomerly | but usually they're in the tens of megabytes if they're big or like small enough to not matter | 18:37:51 |
awesomerly | but i worry that if i only want the info from a certain lump and from the header file | 18:38:06 |
awesomerly | that reading the entire thing into memory will be excessive | 18:38:11 |