RSSAmplifier

Swatinem · Apr 20, 2022

The magic of AsRef

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Both at work, and also personally, I do think about efficient parsers and data formats a lot. Some time ago, I also wrote an article about writing a custom binary format and associated parser. That exercise started something like this: # [ repr (C)] struct Header { version : u32 , num_a : u32 , num_b : u32 , } pub struct Format < 'data > { buf : & 'data [ u8 ], header : & 'data Header, } impl <…

Read on swatinem.de

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.