Macro standard_id

Source
macro_rules! standard_id {
    ($n:expr) => { ... };
}
Expand description

Construct a StandardId that is checked at compile time.

You can use any expression that can be evaluated at compile time and results in a u16.

Usage:

let id: StandardId = standard_id!(0x100 | 0x005);
assert!(id.as_u16() == 0x105);

Will not accept invalid IDs:

let id: StandardId = standard_id!(0x800);