pub struct ClientRoleHandle { /* private fields */ }Expand description
Client role: reads and direct B/IP WriteProperty over shared egress/coordinator.
Borrowed from a running EndpointSession
via client() / cloned_client_handle(). No lifecycle methods: after the
owning session stops or drops, every call returns
Error::Encoding ("endpoint shutdown"). Send + Sync, so clones may outlive the session borrow and
move across tasks.
Service scope is unsegmented RP/RR/RPM and direct B/IP WriteProperty. Explicit destinations preserve data attributes and ingress provenance. When source Audit reporting is selected, only direct B/IP IPv4 unicast targets are admitted. Audited calls are session-owned before egress: dropping their caller does not cancel an admitted request or its terminal observation. Other calls retain caller-owned cancellation. Stop/drop may discard undelivered source records.
Implementations§
Source§impl ClientRoleHandle
impl ClientRoleHandle
Sourcepub async fn write_property(
&self,
destination_mac: &[u8],
request: WritePropertyRequest,
commandability: Commandability,
) -> Result<(), Error>
pub async fn write_property( &self, destination_mac: &[u8], request: WritePropertyRequest, commandability: Commandability, ) -> Result<(), Error>
Write one property to a direct B/IP IPv4 unicast peer through the shared requester.
commandability is required even without a source Reporter. It controls Audit
filtering only: the supplied wire priority and complete encoded value are preserved.
Empty lists are allowed; malformed TLVs and oversized unsegmented requests fail
before traffic. An eligible admitted write remains session-owned after caller
cancellation. Retries share one Invoke ID and produce at most one source record.
Sourcepub async fn read_property(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
) -> Result<ReadPropertyACK, Error>
pub async fn read_property( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, ) -> Result<ReadPropertyACK, Error>
Direct ReadProperty (no routing attributes).
ACK object/property/index correlation matches the standalone client. Device/Network Port wildcard requests accept a same-type concrete ACK; other mismatches return a decoding error.
Fails closed with "endpoint shutdown" once the owning session stops
or drops. Timeouts/retries come from the session config (or the
composed identity’s max-APDU override for the length clamp).
Sourcepub async fn read_property_with_destination(
&self,
destination: EndpointApduDestination,
data_attributes: Vec<DataAttribute>,
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
) -> Result<ReadPropertyACK, Error>
pub async fn read_property_with_destination( &self, destination: EndpointApduDestination, data_attributes: Vec<DataAttribute>, object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, ) -> Result<ReadPropertyACK, Error>
Explicit-destination ReadProperty with pass-through attributes.
Covers routed, local-broadcast and addressed destinations the direct
shorthand cannot spell. Same fail-closed shutdown semantics as
read_property. A routed destination names one
device: a network outside 1..=65534, or a MAC that is empty or longer
than 18 octets, fails with Error::Encoding before a transaction
is reserved, as does a broadcast destination. Once the session knows
its own network’s number, a routed destination naming it goes to its
MAC with no DNET (#1403). The answer from that MAC completes the read,
and so does one a router relays back with that number as its SNET and
that MAC as its SADR (#1465).
Sourcepub async fn read_property_multiple(
&self,
destination_mac: &[u8],
specs: Vec<ReadAccessSpecification>,
) -> Result<ReadPropertyMultipleACK, Error>
pub async fn read_property_multiple( &self, destination_mac: &[u8], specs: Vec<ReadAccessSpecification>, ) -> Result<ReadPropertyMultipleACK, Error>
Read 1–64 explicit property references across nonempty concrete objects.
ALL/REQUIRED/OPTIONAL and wildcard objects are excluded from this endpoint profile. Index zero is valid. Responses must match complete ordered occurrences; inline errors may omit a requested index. An active source Reporter emits one value-free record per eligible occurrence, sharing one operation, timestamp, invoke ID and recipient snapshot.
Sourcepub async fn read_property_multiple_with_destination(
&self,
destination: EndpointApduDestination,
data_attributes: Vec<DataAttribute>,
specs: Vec<ReadAccessSpecification>,
) -> Result<ReadPropertyMultipleACK, Error>
pub async fn read_property_multiple_with_destination( &self, destination: EndpointApduDestination, data_attributes: Vec<DataAttribute>, specs: Vec<ReadAccessSpecification>, ) -> Result<ReadPropertyMultipleACK, Error>
Explicit RPM destination and pass-through attributes. Audited operations require direct B/IP IPv4 unicast, which includes a routed destination naming the session’s own network number once it is known (#1403); all responses remain unsegmented.
Sourcepub async fn read_range(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
range: Option<RangeSpec>,
) -> Result<ReadRangeAck, Error>
pub async fn read_range( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, range: Option<RangeSpec>, ) -> Result<ReadRangeAck, Error>
Read a list/log range through the shared unsegmented requester.
An active source Reporter emits one value-free READ record per attempted operation. Audited destinations must be direct B/IP unicast. Invalid selectors, array index zero, counts and ByTime components fail prewire.
Sourcepub async fn read_range_with_destination(
&self,
destination: EndpointApduDestination,
data_attributes: Vec<DataAttribute>,
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
range: Option<RangeSpec>,
) -> Result<ReadRangeAck, Error>
pub async fn read_range_with_destination( &self, destination: EndpointApduDestination, data_attributes: Vec<DataAttribute>, object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, range: Option<RangeSpec>, ) -> Result<ReadRangeAck, Error>
Explicit destination and pass-through attributes for ReadRange.
Routed destinations are available when source reporting is not selected
for the operation, under the same one-device rule as
read_property_with_destination.
A routed destination naming the session’s own network number, once it
is known, goes direct and can be audited (#1403). Responses remain
unsegmented.
Sourcepub async fn read_range_with(
&self,
destination_mac: &[u8],
request: &ReadRangeRequest,
validation: ReadRangeValidation,
) -> Result<ReadRangeReply, Error>
pub async fn read_range_with( &self, destination_mac: &[u8], request: &ReadRangeRequest, validation: ReadRangeValidation, ) -> Result<ReadRangeReply, Error>
Read a range of items, choosing how to treat an acknowledgement that
breaks a rule, as
BACnetClient::read_range_with
does. Audited like read_range.
Sourcepub async fn read_log_page(
&self,
destination_mac: &[u8],
log: ObjectIdentifier,
cursor: LogCursor,
page_size: u16,
) -> Result<LogPage, Error>
pub async fn read_log_page( &self, destination_mac: &[u8], log: ObjectIdentifier, cursor: LogCursor, page_size: u16, ) -> Result<LogPage, Error>
Read one page of log’s Log_Buffer from cursor, as
bacnet_client::log_reader::read_log_page does; each request is
audited like any other read, and paced by the session’s
min_request_interval_ms
as a paced BACnetClient’s are.
Trait Implementations§
Source§impl Clone for ClientRoleHandle
impl Clone for ClientRoleHandle
Source§impl LogRequester for ClientRoleHandle
impl LogRequester for ClientRoleHandle
Source§async fn read_unsigned(
&self,
mac: &[u8],
log: ObjectIdentifier,
property: PropertyIdentifier,
) -> Result<u64, Error>
async fn read_unsigned( &self, mac: &[u8], log: ObjectIdentifier, property: PropertyIdentifier, ) -> Result<u64, Error>
property of log at mac as an Unsigned.Source§async fn read_range_lenient(
&self,
mac: &[u8],
request: &ReadRangeRequest,
) -> Result<ReadRangeReply, Error>
async fn read_range_lenient( &self, mac: &[u8], request: &ReadRangeRequest, ) -> Result<ReadRangeReply, Error>
mac and check its answer leniently.