oid

Macro oid 

Source
macro_rules! oid {
    ($($arc:expr),* $(,)?) => { ... };
}
Expand description

Macro to create an OID at compile time.

This is the preferred way to create OID constants since it’s concise and avoids parsing overhead.

§Examples

use async_snmp::oid;

// Create an OID for sysDescr.0
let sys_descr = oid!(1, 3, 6, 1, 2, 1, 1, 1, 0);
assert_eq!(sys_descr.to_string(), "1.3.6.1.2.1.1.1.0");

// Trailing commas are allowed
let sys_name = oid!(1, 3, 6, 1, 2, 1, 1, 5, 0,);

// Can use in const contexts (via from_slice)
let interfaces = oid!(1, 3, 6, 1, 2, 1, 2);
assert!(sys_descr.starts_with(&oid!(1, 3, 6, 1, 2, 1, 1)));