Articles tagged #macros

Page 1
The thumbnail for this page

The builder pattern, and a macro that keeps FFI code DRY

Oct 12, 2019
12 min #networking · #icmp · #rust · #macros

Our ping API is simple, but it’s also very limited:

pub fn ping(dest: ipv4::Addr) -> Result<(), String> // called as: ping(ipv4::Addr([8, 8, 8, 8])).unwrap();

It doesn’t allow specifying the TTL (time to live) of packets, it doesn’t allow specifying the timeout, it doesn’t let one specify the data to send along, and it doesn’t give us any kind of information on the reply.

Read more
Page 1

Go back to the homepage.

Ko-fi GitHub Sponsors Patreon
Bluesky Mastodon YouTube
TikTok Instagram RSS
About Legal Notice Privacy Policy Terms and Conditions