Skip to main content

ClientRoleHandle

Struct ClientRoleHandle 

Source
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

Source

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.

Source

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).

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl LogRequester for ClientRoleHandle

Source§

async fn read_unsigned( &self, mac: &[u8], log: ObjectIdentifier, property: PropertyIdentifier, ) -> Result<u64, Error>

Read property of log at mac as an Unsigned.
Source§

async fn read_range_lenient( &self, mac: &[u8], request: &ReadRangeRequest, ) -> Result<ReadRangeReply, Error>

Send one ReadRange to mac and check its answer leniently.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more