| Crates.io | netgauze-udp-notif-pkt |
| lib.rs | netgauze-udp-notif-pkt |
| version | 0.9.0 |
| created_at | 2024-11-05 16:54:19.735838+00 |
| updated_at | 2026-01-19 10:35:59.749822+00 |
| description | UDP-Notif (draft-ietf-netconf-udp-notif) packet library for YANG Push streaming telemetry. Provides zero-copy wire format handling, automatic JSON/CBOR deserialization, and type-safe access to RFC 8639/8641 subscription notifications. |
| homepage | https://github.com/NetGauze/NetGauze |
| repository | https://github.com/NetGauze/NetGauze |
| max_upload_size | |
| id | 1436820 |
| size | 169,229 |
A complete Rust implementation of draft-ietf-netconf-udp-notif for UDP-based transport of YANG Push streaming telemetry notifications.
Bytes-based for raw payload handlingapplication/yang-data+json) and CBOR (application/yang-data+cbor)The library provides three levels of abstraction:
raw - Wire Format LayerDirect access to UDP-Notif packet structure with unparsed payload bytes. Use for maximum performance, custom processing, or protocol-level inspection.
use udp_notif_pkt::raw::UdpNotifPacket;
// Access packet metadata and raw payload
let version = packet.version();
let publisher_id = packet.publisher_id();
let payload_bytes = packet.payload();
decoded - Parsed Notification LayerAutomatic JSON/CBOR deserialization into structured Rust types. Use for type-safe access to notification contents.
use udp_notif_pkt::decoded::{UdpNotifPacketDecoded, UdpNotifPayload};
let decoded: UdpNotifPacketDecoded = (&raw_packet).try_into()?;
match decoded.payload() {
UdpNotifPayload::NotificationEnvelope(envelope) => {
// Handle modern format
}
UdpNotifPayload::NotificationLegacy(legacy) => {
// Handle legacy format
}
}
notification - YANG Data StructuresComplete YANG Push notification types (subscriptions, updates, lifecycle events).
use udp_notif_pkt::notification::NotificationVariant;
match variant {
NotificationVariant::YangPushUpdate(update) => {
println!("Update for subscription {}", update.id());
}
NotificationVariant::SubscriptionStarted(sub) => {
println!("Subscription started with encoding {:?}", sub.encoding());
}
// ... handle other notification types
}