Skip to main content

BACnetObject

Trait BACnetObject 

Source
pub trait BACnetObject:
    Send
    + Sync
    + StoredObject {
Show 53 methods // Required methods fn object_identifier(&self) -> ObjectIdentifier; fn object_name(&self) -> &str; fn read_property( &self, property: PropertyIdentifier, array_index: Option<u32>, ) -> Result<PropertyValue, Error>; fn write_property( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>; fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>; // Provided methods fn write_property_from( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, _origin: &CommandOrigin, ) -> Result<(), Error> { ... } fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]> { ... } fn is_writable_property(&self, property: PropertyIdentifier) -> bool { ... } fn is_array_property(&self, property: PropertyIdentifier) -> bool { ... } fn is_list_property(&self, property: PropertyIdentifier) -> bool { ... } fn is_createable(&self) -> bool { ... } fn creation_only_properties(&self) -> &'static [PropertyIdentifier] { ... } fn initialize_property( &mut self, _property: PropertyIdentifier, _value: PropertyValue, ) -> Result<(), Error> { ... } fn is_deleteable(&self) -> bool { ... } fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]> { ... } fn supports_cov(&self) -> bool { ... } fn supports_subscribe_cov_property(&self) -> bool { ... } fn supports_cov_property(&self, property: PropertyIdentifier) -> bool { ... } fn cov_increment(&self) -> Option<f64> { ... } fn cov_reported_properties(&self) -> &'static [CovReportedProperty] { ... } fn set_overridden(&mut self, _overridden: bool) { ... } fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome> { ... } fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome> { ... } fn tick_schedule( &mut self, _today: SpecificDate, _time: Time, _calendar_active: &dyn Fn(ObjectIdentifier) -> bool, ) -> Option<ScheduleWrite> { ... } fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite> { ... } fn complete_schedule_write( &mut self, _write: &ScheduleWrite, _outcomes: &[ScheduleTargetOutcome], ) -> bool { ... } fn retry_refusals_naming( &self, _target: ObjectIdentifier, ) -> Option<ScheduleWrite> { ... } fn acknowledge_alarm( &mut self, _transition_bit: EventTransitionBits, ) -> Result<(), Error> { ... } fn apply_life_safety_operation( &mut self, _operation: LifeSafetyOperation, ) -> Result<LifeSafetyOperationOutcome, Error> { ... } fn set_life_safety_operation_expected_internal( &mut self, _operation: LifeSafetyOperation, ) -> Result<(), Error> { ... } fn set_event_state_internal( &mut self, _state: EventState, ) -> Result<(), Error> { ... } fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState> { ... } fn set_enrollment_eval_state_internal( &mut self, _state: EventEnrollmentEvalState, ) -> Result<(), Error> { ... } fn enrollment_eval_source_internal( &self, ) -> Option<Option<EventEnrollmentMonitoredSource>> { ... } fn set_enrollment_eval_source_internal( &mut self, _source: Option<EventEnrollmentMonitoredSource>, ) -> Result<(), Error> { ... } fn set_acked_transitions_internal( &mut self, _transition_bit: EventTransitionBits, _acknowledged: bool, ) -> Result<(), Error> { ... } fn evaluate_reliability_internal( &mut self, ) -> Result<ReliabilityEvaluation, Error> { ... } fn set_reliability_internal( &mut self, _reliability: Reliability, ) -> Result<(), Error> { ... } fn set_present_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error> { ... } fn set_present_value_from_internal( &mut self, value: PropertyValue, _origin: &CommandOrigin, ) -> Result<(), Error> { ... } fn set_tracking_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error> { ... } fn report_access_input_internal( &mut self, _input: AccessControlInput, ) -> Result<(), Error> { ... } fn set_controlled_variable_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error> { ... } fn add_averaging_sample_internal( &mut self, _sample: Option<PropertyValue>, ) -> Result<(), Error> { ... } fn audit_log_storage_internal(&self) -> Option<&dyn AuditLogStorage> { ... } fn audit_log_notification_sink_internal( &mut self, ) -> Option<&mut dyn AuditLogNotificationSink> { ... } fn file_storage_internal(&self) -> Option<&dyn FileStorage> { ... } fn file_storage_internal_mut(&mut self) -> Option<&mut dyn FileStorage> { ... } fn log_record_identities_internal(&self) -> Option<Vec<LogRecordIdentity>> { ... } fn log_buffer_internal(&self) -> Option<&dyn LogBufferRecords> { ... } fn add_trend_record( &mut self, _record: BACnetLogRecord, ) -> Result<(), Error> { ... } fn add_trend_multiple_record( &mut self, _record: BACnetLogMultipleRecord, ) -> Result<(), Error> { ... } fn add_event_log_record( &mut self, _record: BACnetEventLogRecord, ) -> Result<(), Error> { ... }
}
Expand description

The core trait for all BACnet objects.

Stored objects have crate-authorized concrete access; borrowed read views remain valid implementors. Applications cannot manufacture its access permit:

ⓘ
use bacnet_objects::traits::ObjectStorageAccess;
let permit = ObjectStorageAccess(());

Implementors represent a single BACnet object (Device, AnalogInput, etc.) and provide read/write access to their properties.

Required Methods§

Source

fn object_identifier(&self) -> ObjectIdentifier

The object’s identifier (type + instance).

Source

fn object_name(&self) -> &str

The object’s name.

Source

fn read_property( &self, property: PropertyIdentifier, array_index: Option<u32>, ) -> Result<PropertyValue, Error>

Read a property value.

Source

fn write_property( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>

Write a property value.

Returning Err MUST leave the object unchanged. WritePropertyMultiple retains earlier successful writes and cannot undo a mutation made by the currently failing write, including for a write-only property.

Refusing one element of a list value, an implementation may name it: Error::Structured with ErrorDetail::FirstFailedElementNumber holding the element’s position, from 1, in the list value carries. The server’s AddListElement handler then reports the request element at that position in its ChangeList-Error (#1048); a plain Error::Protocol there names the first element the list would gain.

Make the checks that don’t depend on the value (the property exists, it is writable now, the array index is in range) before judging the value’s datatype, and refuse a value of the wrong datatype with PROPERTY / INVALID_DATA_TYPE. The bundled server reads that refusal of a NULL, on a property that isn’t commandable and has no NULL in its datatype, as a success that leaves the property as it is (Clauses 15.9.2 and 19.2.1, #1396), so an access check made after the datatype check would never be seen for a NULL.

Source

fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>

List all properties this object supports in the legacy projection.

For migrated objects this includes Object_Identifier, Object_Name, and Object_Type but omits Property_List. Reading the BACnet Property_List property applies the additional wire-level universal-property filter.

Provided Methods§

Source

fn write_property_from( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, _origin: &CommandOrigin, ) -> Result<(), Error>

Write with explicit actual command provenance. Standalone callers assert the origin; server boundaries additionally validate ingress or membership. Decorators must forward this hook without discarding the origin. The default preserves custom/unaffected object behavior. First-party source-tracked commands require this hook and deny context-free writing.

Source

fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]>

Return canonical metadata for this object’s effective property rows.

Migrated implementations return every supported standard row for the current instance, including PROPERTY_LIST. Borrowed rows cover static or object-owned metadata; owned rows support dynamically assembled per-instance sets. An empty borrowed default marks an object as unmigrated.

Source

fn is_writable_property(&self, property: PropertyIdentifier) -> bool

Whether a property write route can accept property for this object.

PICS generation and runtime dispatch MUST consult this (or write_property_from where source authority is required) rather than a separate heuristic, so the PICS writable flags cannot drift from the actual write routes. The default reproduces the historical PICS heuristic (see historical_writable_default) so unmigrated object types keep their current PICS output. Object implementations override to mirror their real write capabilities, including required command origin and ownership.

Universal read-only properties (OBJECT_IDENTIFIER, OBJECT_TYPE, PROPERTY_LIST, STATUS_FLAGS) are always non-writable and are excluded by the default; overrides should preserve that invariant.

Built-in analog, binary, multi-state, Event Enrollment, and Alert Enrollment objects also deny network writes to ACKED_TRANSITIONS. The property descriptions accompanying ASHRAE 135-2020 Tables 12-2/3/4, 12-6/8/10, 12-21/22/23, 12-14, and 12-61 explicitly make it read-only; the table’s R/O classification alone is not a write prohibition. Clause 13.2.3 assigns acknowledgment-bit maintenance to internal transition and acknowledgment processing. Those lifecycle hooks and supported AcknowledgeAlarm paths do not use write_property, so this network restriction does not prevent their internal updates.

Source

fn is_array_property(&self, property: PropertyIdentifier) -> bool

Whether property accepts an array index on this object.

Per Clause 12.1.5.1, only BACnetARRAY (and BACnetARRAY of BACnetLIST) properties accept an array index; Clause 12.1.5.2 makes ReadRange the only positional access to a BACnetLIST. The RP/RPM/WP/WPM service handlers gate the request’s array index on this query and reject a supplied index on a non-array property with PROPERTY / PROPERTY_IS_NOT_AN_ARRAY (Clause 15.5.1.3, Clause 15.9.1.3).

The default reproduces the standard’s classification (see array_property_default): identifier-stable arrays are admitted without consulting the object type, the identifiers whose datatype changes with the object type (ACTION, ALARM_VALUES / FAULT_VALUES, LIST_OF_OBJECT_PROPERTY_REFERENCES, LOG_DEVICE_OBJECT_PROPERTY, PRESENT_VALUE) classify by object_identifier().object_type(), and everything else — scalars and BACnetLIST properties — rejects the index. The built-in objects keep the default, so clients that classify with standard_array_property agree with them; object implementations with vendor array properties override.

Source

fn is_list_property(&self, property: PropertyIdentifier) -> bool

Whether property is a BACnetLIST on this object.

AddListElement and RemoveListElement (Clauses 15.1 and 15.2) edit only BACnetLIST properties, and ReadRange (Clause 15.8) reads only them. The server’s handlers ask this before decoding any element or selecting any item, and refuse every other target, including an array element, with SERVICES / PROPERTY_IS_NOT_A_LIST. Like Self::is_array_property, the answer follows the property’s datatype, not the shape of a value read: a whole array also reads as a list, and constructed single values often read as framed bytes.

The default reproduces the standard’s classification (see list_property_default): identifier-stable lists are admitted on every object type, and the identifiers whose datatype changes with the object type (ALARM_VALUES / FAULT_VALUES, LIST_OF_OBJECT_PROPERTY_REFERENCES, PRESENT_VALUE, MEMBER_OF) classify by object_identifier().object_type(). The built-in objects keep the default; object implementations with vendor list properties override.

Source

fn is_createable(&self) -> bool

Whether this object type can be created at runtime via CreateObject.

Default false; override true only for types the network factory (handle_create_object) actually constructs, so PICS createability matches the runtime factory with no separate list to drift.

Source

fn creation_only_properties(&self) -> &'static [PropertyIdentifier]

The properties whose whole value a CreateObject initial value may set on this object although WriteProperty can’t change it afterwards.

Clause 15.3 doesn’t limit initial values to the properties WriteProperty can change, so a device may take some of its read-only properties at creation. The bundled server hands such an initial value, written without an array index, to Self::initialize_property instead of the write route; every other initial value goes the way a WriteProperty does. The PICS lists the set for each createable type. Default empty: no property is set only at creation.

Source

fn initialize_property( &mut self, _property: PropertyIdentifier, _value: PropertyValue, ) -> Result<(), Error>

Apply a CreateObject initial value to one of Self::creation_only_properties, written whole.

The server calls this only on the object it is creating, before any other request can see it. Check the value as a write would, and on Err leave the object unchanged: the server then refuses the request, naming the initial value, and drops the object. As on the write route, an initial value that is one application NULL and that this refuses with PROPERTY / INVALID_DATA_TYPE leaves the property as it is and counts as applied, so refuse a NULL that way. The default refuses every property with PROPERTY / WRITE_ACCESS_DENIED, the answer for a property that can’t be initialized at creation (Clause 15.3.1.3.1).

The bundled server’s CreateObject builds only built-in objects today (Analog Input and Output, the binary types and the multi-state types), so on a custom object this hook is reached only by a caller that builds the object itself.

Source

fn is_deleteable(&self) -> bool

Whether this object type can be deleted at runtime via DeleteObject.

Default true; override false on object types that are not deleteable (e.g. Device, NetworkPort).

Source

fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>

List the REQUIRED properties for this object type.

Migrated objects derive this set from canonical R and W rows, including Property_List. Unmigrated objects retain the historical four universal properties. Service-specific consumers may exclude Property_List where their protocol contract requires it.

Source

fn supports_cov(&self) -> bool

Whether this object type supports COV notifications.

Override to return true for object types that can generate COV notifications (analog, binary, multi-state I/O/V). Default is false. This answer admits SubscribeCOV, the whole-object form, and is the default for supports_subscribe_cov_property.

Source

fn supports_subscribe_cov_property(&self) -> bool

Whether SubscribeCOVProperty and SubscribeCOVPropertyMultiple may monitor this object’s properties.

Defaults to supports_cov. An object that has no whole-object COV criteria, because Clause 13.1’s Table 13-1 doesn’t list its type, can still return true here while supports_cov stays false: its property subscriptions then follow Table 13-1a and SubscribeCOV is refused. The built-in Averaging object does this. supports_cov_property still decides each property.

Source

fn supports_cov_property(&self, property: PropertyIdentifier) -> bool

Whether a readable property supports property-specific COV.

The default preserves the existing behavior of every other COV-capable object family while enforcing the bounded standardized Life Safety surface for source-compatible custom Point and Zone implementations. Other types answer supports_subscribe_cov_property for every property.

Source

fn cov_increment(&self) -> Option<f64>

COV increment for this object (objects with a COV_Increment property).

Returns Some(increment) for objects that use COV_Increment filtering (e.g., AnalogInput, AnalogOutput, AnalogValue, Loop, Staging, and the Integer, Positive Integer and Large Analog Value types). A notification fires only when the numeric Present_Value delta reaches the increment. Property COV inherits this increment only for numeric Present_Value; other selected properties use their own supplied increment or typed change reporting.

The increment is an f64 so every COV_Increment datatype fits without rounding: a REAL widens exactly, a Large Analog Value’s Double is kept as is, and an Unsigned increment is exact up to 2^53.

Returns None for objects that notify on any state change (binary, multi-state).

Source

fn cov_reported_properties(&self) -> &'static [CovReportedProperty]

Properties a whole-object (SubscribeCOV) notification reports after its leading value and Status_Flags, in report order.

The leading value is Present_Value, except on Access Point, whose Table 13-1 row leads with Access_Event; the server chooses it by object type. The default follows the object type’s Table 13-1 row:

  • Access Door: Door_Alarm_State, a trigger.
  • Access Point: Access_Event_Tag, Access_Event_Time (a trigger), Access_Event_Credential and Access_Event_Authentication_Factor.
  • Credential Data Input: Update_Time, a trigger.
  • Load Control: Requested_Shed_Level, Start_Time, Shed_Duration and Duty_Window, all triggers.
  • Loop: Setpoint and Controlled_Variable_Value.
  • Pulse Converter: Update_Time.
  • Staging: Present_Stage, a trigger.

A trigger’s change sends a notification by itself; any other listed value only rides along. Every other type reports nothing more. The server leaves out a listed property the object’s Property_List lacks. Property subscriptions (SubscribeCOVProperty and SubscribeCOVPropertyMultiple) report their own property instead.

Source

fn set_overridden(&mut self, _overridden: bool)

Set the OVERRIDDEN bit in StatusFlags.

For software-only objects this is always FALSE per spec. Hardware integrations can override to set TRUE when present_value is overridden by physical means (e.g., a manual switch on an output).

Source

fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>

Evaluate intrinsic reporting after a present_value change.

This is the per-write entry point: it seeds (or cancels) a pending delayed transition and fires immediately only when Time_Delay == 0. It never advances the Time_Delay countdown — repeated writes to the same value do not shorten the delay (ASHRAE 135-2020 Clause 13.3 counts the delay in seconds, so the countdown advances once per elapsed second via tick_intrinsic_reporting).

Returns Some(TransitionOutcome) whenever a transition is ready to be committed, or None when none did (no change, delay seeded, or the object does not support intrinsic reporting). A cleared Event_Enable bit sets the outcome’s distribute flag to false rather than withholding the transition. Implementations must leave Event_State, Acked_Transitions, event history, and fire-ready detector state unchanged until commit_event_transition_internal succeeds. Clause 13.2.2.1.4’s transition actions run either way, and Event_Enable disables only external distribution, downstream in the notification-distribution process (Clause 13.2.5).

Source

fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>

Advance the Time_Delay countdown for a pending transition.

Called by the server’s one-second intrinsic-reporting task. Fires the pending transition when its delay elapses this tick, cancels it if the triggering condition reverted, and returns Some(TransitionOutcome) when a transition is ready. A fire-ready proposal must remain retryable until the commit hook succeeds. As with evaluate_intrinsic_reporting, Event_Enable is reported via distribute, not by returning None. Objects without a delayed transition return None.

Source

fn tick_schedule( &mut self, _today: SpecificDate, _time: Time, _calendar_active: &dyn Fn(ObjectIdentifier) -> bool, ) -> Option<ScheduleWrite>

Evaluate this object’s schedule at time on today (Clause 12.24.4).

calendar_active answers for a special event whose period references a Calendar: whether that Calendar is TRUE on today. Returns the writes owed when Present_Value changed, the object has just entered its Effective_Period, or its references or priority changed since the last write, with the complete local references, target array indices included. Otherwise, while some references refused their last write, returns a retry of the current value to those references only (#1436). Only meaningful for Schedule objects; default returns None.

Source

fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite>

Take the writes this schedule owes its targets apart from its calculation, each once, in order: a NULL to every priority slot a change of List_Of_Object_Property_References or Priority_For_Writing left behind (#1088), then the Present_Value owed out of service, for a client’s write (Clause 12.24.14) or a change of those two properties.

A schedule pass collects them before calling tick_schedule, so they reach the targets ahead of any calculated value; they need no clock. Only meaningful for Schedule objects; default returns none.

Source

fn complete_schedule_write( &mut self, _write: &ScheduleWrite, _outcomes: &[ScheduleTargetOutcome], ) -> bool

Report how each target took write, one of this schedule’s writes: outcomes holds one entry per member of write.references, in order.

A Schedule judges the reference half of its Reliability from these (Clause 12.24.13, #1086). Returns whether a readable property, such as Reliability, changed. Only meaningful for Schedule objects; default returns false.

Source

fn retry_refusals_naming( &self, _target: ObjectIdentifier, ) -> Option<ScheduleWrite>

The retry of the current value to the references whose last write was refused and that name target, an object just added to the database (#1440), so the refusal can clear without waiting for the next pass. None when no such refusal stands, or when the pass itself would retry nothing: out of service, outside Effective_Period, or with a NULL Present_Value. Only meaningful for Schedule objects; default returns None.

Source

fn acknowledge_alarm( &mut self, _transition_bit: EventTransitionBits, ) -> Result<(), Error>

Acknowledge an alarm transition. Sets the transition_bit flags in acked_transitions. Returns Ok(()) if the object supports event detection, Err otherwise.

Source

fn apply_life_safety_operation( &mut self, _operation: LifeSafetyOperation, ) -> Result<LifeSafetyOperationOutcome, Error>

Apply a LifeSafetyOperation atomically to this object.

Implementations must leave the object unchanged when returning Err. They run synchronously under the object-database write lock and must be fast, nonblocking, and panic-free. External or irreversible actuation also needs an application-owned idempotency/replay contract. The default reports that the object does not support this service. Successful implementations return an outcome with exact, ordered, deduplicated committed property changes. AlreadyApplied leaves all state unchanged and reports no deltas. The bundled server uses these changes for COV after releasing the database lock and dispatching the service response.

Source

fn set_life_safety_operation_expected_internal( &mut self, _operation: LifeSafetyOperation, ) -> Result<(), Error>

Set the next LifeSafetyOperation expected by trusted local logic.

This is an application-facing state channel, not a network property write. The default reports that the object does not support the state.

Source

fn set_event_state_internal(&mut self, _state: EventState) -> Result<(), Error>

Apply an internally-detected Event_State transition.

This is the internal lifecycle path for the algorithmically-derived Event_State on objects such as Event Enrollment (ASHRAE 135-2020 Clause 12.12). It is deliberately distinct from the network write_property route: Event_State is read-only over the network, so network writes are rejected while the server’s evaluator reaches the field through this method. Objects without an algorithmic Event_State return OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED.

The default returns Err, so objects without an algorithmic Event_State opt out. Objects that do model one (e.g. EventEnrollmentObject) override this to store the value verbatim: the only caller is a trusted internal evaluator that passes a modeled EventState, mirroring the inherent set_event_state builder and the existing read arm. Network-facing validation — rejecting all Event_State writes — lives in write_property, not here. Implementations must leave Event_State unchanged when they return Err.

Source

fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState>

Snapshot this object’s Event Enrollment evaluation state, if it models one.

This is the read half of the internal channel the server’s Event Enrollment evaluator uses to persist per-enrollment algorithm state across evaluation cycles: the pending (delayed) transition countdown, the CHANGE_OF_VALUE detection baseline (the monitored sample at the latest NORMAL indication, per Clause 13.3.3), and the monitored value behind the most recent OFFNORMAL transition (Clause 13.3.2 condition (c)). Like set_event_state_internal it deliberately bypasses the network property model: none of the three slots is a BACnet property, and 135-2020 assigns their initialization to local matters.

The default returns None — objects without algorithmic event detection carry no such state, and the evaluator treats None as an empty state it cannot write back (delay honoring and the COV baseline then stay unavailable, matching this crate’s pre-delay behavior).

Source

fn set_enrollment_eval_state_internal( &mut self, _state: EventEnrollmentEvalState, ) -> Result<(), Error>

Store this object’s Event Enrollment evaluation state.

The write half of enrollment_eval_state_internal. The only caller is the trusted server evaluator, passing a state it derived from a prior snapshot plus the current cycle’s evaluation. Implementations enforce the Clause 13.2.2.1 invariant by construction: transitions are prohibited while Event_Detection_Enable is FALSE, so a write arriving then is refused rather than queued (and the detection-disable reset has already cleared the fields).

The default returns Err, so objects without enrollment evaluation state opt out and the evaluator’s write-back is dropped, never stored into an object that does not model it.

Source

fn enrollment_eval_source_internal( &self, ) -> Option<Option<EventEnrollmentMonitoredSource>>

Snapshot the monitored source that owns Event Enrollment private state.

The outer Option indicates whether the object supports this channel; the inner Option is empty before a source has been established. The server stores source ownership in its object database when an object implements evaluation state but leaves this channel unsupported.

Source

fn set_enrollment_eval_source_internal( &mut self, _source: Option<EventEnrollmentMonitoredSource>, ) -> Result<(), Error>

Store or clear the monitored source that owns Event Enrollment state.

Source

fn set_acked_transitions_internal( &mut self, _transition_bit: EventTransitionBits, _acknowledged: bool, ) -> Result<(), Error>

Set or clear one Acked_Transitions bit on a received event-state transition.

Implements the alarm-acknowledgment half of Clause 13.2.2.1.4’s fourth transition action: pass the transition to alarm-acknowledgment handling. Under Clause 13.2.3, receiving a transition updates its Acked_Transitions bit to the inverse of the corresponding Ack_Required bit. The caller (the server evaluator) resolves Ack_Required from the referenced Notification Class object and passes the outcome as acknowledged; this method performs only the bit maintenance.

transition_bit is the transition direction’s flag, as returned by EventTransition::bit_mask. The set half overlaps the network-reachable acknowledge_alarm, which also ORs the bit in per Clause 13.2.3’s acknowledgment-indication paragraph; the clear half has no network route by design (a property write could fabricate or erase acknowledgments — see the write_generic_event_properties! denial comment).

The default returns Err, so objects without an algorithmic Acked_Transitions opt out.

Source

fn evaluate_reliability_internal( &mut self, ) -> Result<ReliabilityEvaluation, Error>

Evaluate and, when necessary, mutate this object’s Reliability.

Reliability evaluation is object-owned: an implementation decides whether and how its internal conditions affect Reliability, performs the mutation itself, and returns ReliabilityEvaluation::Changed only after that mutation succeeds. ReliabilityEvaluation::Unchanged means the object made no mutation. Returning Err MUST leave all object state unchanged.

The default opts out without changing state, preserving source compatibility for object implementations that do not own a reliability evaluation algorithm.

Source

fn set_reliability_internal( &mut self, _reliability: Reliability, ) -> Result<(), Error>

Apply an internally-derived Reliability value.

This is the internal reliability-evaluation path, distinct from the network write_property route. Implementations enforce symmetric ownership: clients may write while Out_Of_Service is TRUE, and internal evaluation may write while it is FALSE. ASHRAE 135-2020 Clause 3.2 describes reliability evaluation as the object’s assessment of its reliability, producing its Reliability property value.

The default rejects the operation, so object types without an internal reliability-evaluation process remain unaffected.

Source

fn set_present_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>

Apply the logical Present_Value supplied by the local application.

This narrow internal hook is distinct from the network write_property route. Built-in Analog Input, Binary Input, and Multi-state Input objects opt in. Their implementations accept application updates only while in service; rejecting them while Out_Of_Service is TRUE is a local ownership policy that protects the client’s simulation value, not a requirement imposed by the Standard.

Analog, Binary, and Multi-state Value objects opt in unless their PresentValueAccess is Commandable. For them, rejecting updates while Out_Of_Service is TRUE is required: their Out_Of_Service clause keeps software local to the device from changing Present_Value.

Life Safety Point and Zone opt in with a BACnetLifeSafetyState. Clients never write their Present_Value, so they take the application’s value in service and out of service alike, and the hook leaves Tracking_Value, Silenced and Operation_Expected as they are: any latching rule belongs to the application.

The default fails closed so commandable and other object families do not acquire privileged Present_Value write authority through this hook.

Source

fn set_present_value_from_internal( &mut self, value: PropertyValue, _origin: &CommandOrigin, ) -> Result<(), Error>

set_present_value_internal on behalf of origin, the local Device the application runs in.

A noncommandable Analog, Binary or Multi-state Value that tracks its Present_Value’s source (#1552) publishes origin as Value_Source after the update, as Clause 19.5 asks of a write the local device makes; plain set_present_value_internal leaves it NONE. The server’s set_present_value_local calls this when it knows its Device. The default ignores origin, and decorators must forward it.

Source

fn set_tracking_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>

Apply the Tracking_Value the local application derived.

Only the built-in Life Safety Point and Zone opt in, with a BACnetLifeSafetyState; the property stays read-only over the network in service. While Out_Of_Service is TRUE a client’s simulated value keeps being served and this one takes over on the return to service. The default fails closed with the same error as set_present_value_internal.

Source

fn report_access_input_internal( &mut self, _input: AccessControlInput, ) -> Result<(), Error>

Apply an input the application reports for an access-control object the server holds (#1132): an Access Point’s access event, a Credential Data Input’s read or an Access Door’s hardware state, each a record whose values change together. See AccessControlInput.

Only the built-in Access Point, Credential Data Input and Access Door opt in, each for its own kind of record. While Out_Of_Service is TRUE the point refuses an event with PROPERTY / WRITE_ACCESS_DENIED, since it performs no authentication then, and the door and the reader store the input with their device values put aside, leaving a client’s simulated values served. The default, and an object offered another kind of record, fails closed with the same error as set_present_value_internal.

Source

fn set_controlled_variable_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>

Apply the Controlled_Variable_Value measured by the local application.

Only the built-in Loop opts in. Its control algorithm runs in the application, which feeds the measured value here while it does so; the property stays read-only over the network. The default fails closed with the same error as set_present_value_internal.

Source

fn add_averaging_sample_internal( &mut self, _sample: Option<PropertyValue>, ) -> Result<(), Error>

Record one sample for an Averaging object.

Only the built-in Averaging object opts in. The value is the reading of the referenced property, or None when the attempt produced no value, and the object updates its sample window, statistics and counts together. The application calls it for the samples it takes, and the database for the ones the object’s own schedule asks for (see take_due_averaging_sample_internal). The default fails closed with the same error as set_present_value_internal.

Source

fn audit_log_storage_internal(&self) -> Option<&dyn AuditLogStorage>

Borrow this object’s Audit Log query storage, if it has any.

This read-only, type-erased channel lets the bundled server execute an AuditLogQuery against an object’s already-loaded retained records. It deliberately does not expose persistence, mutation, or object downcasting. The default returns None; an Audit Log object that does not opt in is reported as SERVICES / OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED.

Source

fn audit_log_notification_sink_internal( &mut self, ) -> Option<&mut dyn AuditLogNotificationSink>

Mutably borrow this object’s Audit notification receiver capability.

The default opts out. Implementations own their persistence transaction and must leave memory unchanged when the batch cannot be committed.

Source

fn file_storage_internal(&self) -> Option<&dyn FileStorage>

Borrow this object’s File storage, if it has any.

This is the read half of the internal channel the server’s AtomicReadFile handler uses to reach file contents. Like set_event_state_internal it bypasses the property model on purpose: Table 12-16 (ASHRAE 135-2020 Clause 12.13) defines no File Data property, so file contents are reachable only through the Clause 14 File Access Services.

The default returns None, so object types without a file opt out; the server reports None on a File-typed object as SERVICES / FILE_ACCESS_DENIED (Clause 18 covers locked or inaccessible files) rather than reading it as empty. Applications backing a File object with their own storage — a disk file, a firmware partition — implement FileStorage and return Some.

Source

fn file_storage_internal_mut(&mut self) -> Option<&mut dyn FileStorage>

Mutably borrow this object’s File storage, if it has any.

The write half of file_storage_internal, used by the AtomicWriteFile handler after the read-only and access-method gates have passed. The default returns None.

Source

fn log_record_identities_internal(&self) -> Option<Vec<LogRecordIdentity>>

Return stable identities aligned with this object’s resident log records.

Implementing log objects return identities oldest-to-newest, in the same order as their public resident-record view and their log_buffer_internal records. Sequence numbers are object-owned metadata and never part of an encoded BACnet record. Non-log objects return None.

Source

fn log_buffer_internal(&self) -> Option<&dyn LogBufferRecords>

Borrow this object’s Log_Buffer records as ReadRange pages them.

The built-in Trend Log, Trend Log Multiple and Event Log objects answer a ReadProperty of Log_Buffer with PROPERTY / READ_ACCESS_DENIED, since their clauses (12.25.14, 12.30.19, 12.27.13) open the buffer to ReadRange only; the server’s ReadRange handler reads it through this channel instead, one encoded record per item. The default returns None, which leaves ReadRange reading the property through read_property.

Source

fn add_trend_record(&mut self, _record: BACnetLogRecord) -> Result<(), Error>

Submit a trend record to an object’s log lifecycle.

Ok(()) means the operation was accepted, not that an ordinary record became resident: disabled logs ignore it and zero-capacity logs may only increment their count. A required status transition can replace the ordinary record. Timestamp failures return an error without mutation. Objects without trend insertion return OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED.

Source

fn add_trend_multiple_record( &mut self, _record: BACnetLogMultipleRecord, ) -> Result<(), Error>

Submit a Trend Log Multiple record, one value per monitored member, to an object’s log lifecycle.

The outcomes match add_trend_record. Objects without Trend Log Multiple insertion return OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED.

Source

fn add_event_log_record( &mut self, _record: BACnetEventLogRecord, ) -> Result<(), Error>

Submit an Event Log record to an object’s log lifecycle.

The server hands the event notifications this device builds to its Event Logs through this hook (ObjectDatabase::log_event_notification). The outcomes match add_trend_record. Objects without Event Log insertion return OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl BACnetObject for AccessCredentialObject

Source§

impl BACnetObject for AccessDoorObject

Source§

impl BACnetObject for AccessPointObject

Source§

impl BACnetObject for AccessRightsObject

Source§

impl BACnetObject for AccessUserObject

Source§

impl BACnetObject for AccessZoneObject

Source§

impl BACnetObject for AccumulatorObject

Source§

impl BACnetObject for AlertEnrollmentObject

Source§

impl BACnetObject for AnalogInputObject

Source§

impl BACnetObject for AnalogOutputObject

Source§

impl BACnetObject for AnalogValueObject

Source§

impl BACnetObject for AuditLogObject

Source§

impl BACnetObject for AuditReporterObject

Source§

impl BACnetObject for AveragingObject

Source§

impl BACnetObject for BinaryInputObject

Source§

impl BACnetObject for BinaryLightingOutputObject

Source§

impl BACnetObject for BinaryOutputObject

Source§

impl BACnetObject for BinaryValueObject

Source§

impl BACnetObject for BitStringValueObject

Source§

impl BACnetObject for CalendarObject

Source§

impl BACnetObject for ChannelObject

Source§

impl BACnetObject for CharacterStringValueObject

Source§

impl BACnetObject for ColorObject

Source§

impl BACnetObject for ColorTemperatureObject

Source§

impl BACnetObject for CommandObject

Source§

impl BACnetObject for CredentialDataInputObject

Source§

impl BACnetObject for DatePatternValueObject

Source§

impl BACnetObject for DateTimePatternValueObject

Source§

impl BACnetObject for DateTimeValueObject

Source§

impl BACnetObject for DateValueObject

Source§

impl BACnetObject for DeviceObject

Source§

impl BACnetObject for ElevatorGroupObject

Source§

impl BACnetObject for EscalatorObject

Source§

impl BACnetObject for EventEnrollmentObject

Source§

impl BACnetObject for EventLogObject

Source§

impl BACnetObject for FileObject

Source§

impl BACnetObject for GlobalGroupObject

Source§

impl BACnetObject for GroupObject

Source§

impl BACnetObject for IntegerValueObject

Source§

impl BACnetObject for LargeAnalogValueObject

Source§

impl BACnetObject for LifeSafetyPointObject

Source§

impl BACnetObject for LifeSafetyZoneObject

Source§

impl BACnetObject for LiftObject

Source§

impl BACnetObject for LightingOutputObject

Source§

impl BACnetObject for LoadControlObject

Source§

impl BACnetObject for LoopObject

Source§

impl BACnetObject for MultiStateInputObject

Source§

impl BACnetObject for MultiStateOutputObject

Source§

impl BACnetObject for MultiStateValueObject

Source§

impl BACnetObject for NetworkPortObject

Source§

impl BACnetObject for NotificationClass

Source§

impl BACnetObject for NotificationForwarderObject

Source§

impl BACnetObject for OctetStringValueObject

Source§

impl BACnetObject for PositiveIntegerValueObject

Source§

impl BACnetObject for ProgramObject

Source§

impl BACnetObject for PulseConverterObject

Source§

impl BACnetObject for ScheduleObject

Source§

impl BACnetObject for StagingObject

Source§

impl BACnetObject for StructuredViewObject

Source§

impl BACnetObject for TimePatternValueObject

Source§

impl BACnetObject for TimeValueObject

Source§

impl BACnetObject for TimerObject

Source§

impl BACnetObject for TrendLogMultipleObject

Source§

impl BACnetObject for TrendLogObject