Providing custom derives

You might have looked at #[derive(Debug)] and assumed it's some weird compiler magic. It is not. It is a so-called procedural macro, that is, a macro that doesn't simply expand at compile time but instead runs at compile time. This way, you can inject code into the actual compilation process. The most useful application for this is creating custom derives, with which you can generate new code based on the analysis of existing code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.75.165