Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
throwaway8948
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
throwaway8948
5y ago
>Can you point out an example on reading a bunch of structs from a file? Without std? Now I'm really curious. Not really, but here is really simple example: use std::fs::File; use std::io::Read; #[derive(Debug)] struct
2.
▲
by
throwaway8948
5y ago
>It should be simple, right? Well, no. If you want to have memory safe subset, you absolutely cannot initialize structs with random bag of bytes in general case. C let's you cut corners here, but in Rust you need to implement (de)se