sntpc-net-std
Standard library UDP socket adapter for the sntpc SNTP client library.
Design Goal
This crate provides a thin wrapper around std::net::UdpSocket that implements the NtpUdpSocket trait from sntpc.
This separation allows:
- Independent versioning: Update
sntpc-net-stdwithout touching coresntpc - Minimal dependencies: Only depends on
stdandsntpccore - Flexibility: Users can choose their network stack independently
Usage
Add this to your Cargo.toml:
[]
= "0.8"
= "1"
Example
use ;
use UdpSocketWrapper;
use UdpSocket;
let socket = bind.expect;
let socket = new;
let context = new;
// Use with sntpc functions
For complete examples, see the sntpc examples.