def_oid
Why yet another OID crate ?
This library allow a compile time OID encoded bytes by using one of the two procedural macros oid and const_oid.
Both macro gives a fixed size array of u8 so it's no runtime overhead.
Use case
oid is used to get a fixed size bytes of OID. It can be used as expression.
some_function(oid!("2.5.4.3")); // some_function will received [85, 4, 3] of type [u8; 3].
const_oid is used to declare fixed size bytes constant variable.
This is useful for global const declaration.
const_oid!(COMMON_NAME, "2.5.4.3"); // Declare const variable "COMMON_NAME" with type [u8; 3]
println!("{:?}", COMMON_NAME); // it should print [85, 4, 3]