pub struct EnterpriseElement {
pub enterprise_number: u32,
pub id: u16,
pub name: Option<String>,
pub data_type: DataType,
pub semantics: Option<DataTypeSemantics>,
pub units: Option<u16>,
pub range_begin: Option<u64>,
pub range_end: Option<u64>,
pub description: Option<String>,
pub source: ElementSource,
}Expand description
Type information of an enterprise-specific Information Element (RFC 5610 Section 3)
Fields§
§enterprise_number: u32Private Enterprise Number (privateEnterpriseNumber, 346)
id: u16Information Element identifier (informationElementId, 303)
name: Option<String>Name (informationElementName, 341)
data_type: DataTypeAbstract data type (informationElementDataType, 339)
semantics: Option<DataTypeSemantics>Data type semantics (informationElementSemantics, 344)
units: Option<u16>Units, as a value of the IANA “IPFIX Information Element Units”
registry (informationElementUnits, 345)
range_begin: Option<u64>Inclusive low end of the range of acceptable values
(informationElementRangeBegin, 342)
range_end: Option<u64>Inclusive high end of the range of acceptable values
(informationElementRangeEnd, 343)
description: Option<String>Human-readable description (informationElementDescription, 340)
source: ElementSourceWhere the definition comes from
Implementations§
Source§impl EnterpriseElement
impl EnterpriseElement
Sourcepub fn new(
enterprise_number: u32,
id: u16,
name: &str,
data_type: DataType,
) -> Self
pub fn new( enterprise_number: u32, id: u16, name: &str, data_type: DataType, ) -> Self
A caller-registered definition with a name and a data type
Sourcepub fn with_semantics(self, semantics: DataTypeSemantics) -> Self
pub fn with_semantics(self, semantics: DataTypeSemantics) -> Self
Set the data type semantics
Sourcepub fn has_valid_semantics(&self) -> bool
pub fn has_valid_semantics(&self) -> bool
Whether the data type and semantics combination is valid (RFC 5610 Section 3.10). Invalid combinations MUST be ignored.
RFC 5610 predates the structured data types (RFC 6313) and
unsigned256 (RFC 9740): lists accept the list semantics, and
unsigned256 follows the other unsigned types.