pub struct Reader<'a, T: TransportPort + 'static> {
pub client: &'a BACnetClient<T>,
pub device: u32,
pub rate: &'a RequestLimits,
pub cancel: &'a AtomicBool,
pub rpm: bool,
}Expand description
Reads one device, one request at a time, each with its turn at the device’s gate and the global rate cap.
Fields§
§client: &'a BACnetClient<T>The client the requests go through.
device: u32The device instance read, looked up in the client’s discovery table.
rate: &'a RequestLimitsThe limits each request waits for.
cancel: &'a AtomicBoolSet to stop the read before its next request.
rpm: boolFalse once the device has refused RPM.
Implementations§
Source§impl<T: TransportPort + 'static> Reader<'_, T>
impl<T: TransportPort + 'static> Reader<'_, T>
Sourcepub async fn turn(&self) -> Result<Turn, Halt>
pub async fn turn(&self) -> Result<Turn, Halt>
Wait for this request’s turn at the device, unless the job was
stopped. Hold it for the one request (see RequestLimits::turn).
A scheduling hook for the TUI’s own request loops; the read methods
take their turns themselves.
Sourcepub async fn free_turn(&self) -> Result<(), Halt>
pub async fn free_turn(&self) -> Result<(), Halt>
Wait until a request could go at once, without taking the device’s
gate or a slot, unless the job was stopped (see
RequestLimits::wait_free). Another worker can take the gate
before Self::turn; the TUI’s name reads, the hook’s one caller,
check again then which names are still wanted.
Sourcepub fn device_object(&self) -> Result<ObjectIdentifier, Halt>
pub fn device_object(&self) -> Result<ObjectIdentifier, Halt>
The Device object.
Sourcepub async fn rp(
&self,
object: ObjectIdentifier,
property: PropertyIdentifier,
index: Option<u32>,
) -> Result<Vec<u8>, Halt>
pub async fn rp( &self, object: ObjectIdentifier, property: PropertyIdentifier, index: Option<u32>, ) -> Result<Vec<u8>, Halt>
ReadProperty, routed if the device is.
Sourcepub async fn properties(
&mut self,
object: ObjectIdentifier,
wanted: Wanted<'_>,
) -> Result<(Vec<RawRow>, ReadVia), Halt>
pub async fn properties( &mut self, object: ObjectIdentifier, wanted: Wanted<'_>, ) -> Result<(Vec<RawRow>, ReadVia), Halt>
The properties wanted of object, by RPM or, once the device has
refused it, by ReadProperty each.