Expand description
§rustnetconf-yang
YANG model code generation for rustnetconf. Generates typed Rust structs from YANG models so your network config is validated at compile time.
§How it works
- Place
.yangmodel files in your project’syang-models/directory - Add
rustnetconf-yangas a dependency - Run
cargo build— the build script generates Rust structs inOUT_DIR - Use the generated types with
edit_config_typed()
ⓘ
// Generated from ietf-interfaces.yang:
use rustnetconf_yang::ietf_interfaces::Interfaces;
let config = Interfaces {
interface: vec![Interface {
name: "ge-0/0/0".into(),
description: Some("uplink".into()),
enabled: Some(true),
..Default::default()
}],
};Modules§
- serialize
- XML serialization helpers for YANG-generated types.