Skip to main content

Module property_element

Module property_element 

Source
Expand description

Which constructed production a property’s value is made of.

A value read from a device arrives as bare octets. For a primitive value the application tags say where each element starts and ends, but a list or array of constructed elements (timestamps, schedule days, references) carries nothing that marks the boundary between one element and the next. Splitting it takes the element’s datatype, and that depends on the object type and the property, which the octets don’t say.

property_element is that knowledge as a table: for each (object type, property) pair whose datatype it knows, the ConstructedElement the value is made of and whether the property holds one of them or a collection (ElementShape). Each element names the codec in crate::constructed (or, for ConstructedElement::ReadAccessResult, the ReadPropertyMultiple ACK decoder in bacnet-services) that decodes it, which split_elements takes to find where each element ends.

The table needs no allocator; split_elements needs alloc.

Enums§

ConstructedElement
A constructed production a property’s value is made of.
ElementShape
How a property holds its elements.

Functions§

property_element
The element property of object_type is made of, and how the property holds it; None for a property this table doesn’t know, whose value the application tags alone describe or whose datatype it doesn’t cover.
split_elements
Where each element of octets ends, with decode reading the element that starts at an offset and returning the offset just past it. None when an element doesn’t decode or decode doesn’t move forward, so a value that isn’t wholly made of the elements is never half split. Empty octets split into no elements.