pub struct BacnetServer<D: DataLink> { /* private fields */ }Expand description
A server that binds a DataLink and dispatches incoming service requests.
Implementations§
Source§impl<D: DataLink> BacnetServer<D>
impl<D: DataLink> BacnetServer<D>
Sourcepub fn new(datalink: D, device_id: u32, handler: impl ServiceHandler) -> Self
pub fn new(datalink: D, device_id: u32, handler: impl ServiceHandler) -> Self
Create a new server with the given datalink and device instance number.
Sourcepub fn with_vendor_id(self, vendor_id: u16) -> Self
pub fn with_vendor_id(self, vendor_id: u16) -> Self
Override the vendor ID sent in I-Am responses (default: 0).
Sourcepub fn serve(self) -> impl Future<Output = ()>
pub fn serve(self) -> impl Future<Output = ()>
Run the serve loop.
Receives frames, parses them, and dispatches:
- UnconfirmedRequest Who-Is (0x08) → I-Am; others ignored.
- ConfirmedRequest ReadProperty (0x0C) → ComplexAck or Error.
- ConfirmedRequest WriteProperty (0x0F) → SimpleAck or Error.
- ConfirmedRequest ReadPropertyMultiple (0x0E) → ComplexAck or Error.
- Any other confirmed service → Reject (UNRECOGNIZED_SERVICE = 0x08).
Auto Trait Implementations§
impl<D> Freeze for BacnetServer<D>
impl<D> !RefUnwindSafe for BacnetServer<D>
impl<D> Send for BacnetServer<D>
impl<D> Sync for BacnetServer<D>
impl<D> Unpin for BacnetServer<D>
impl<D> UnsafeUnpin for BacnetServer<D>
impl<D> !UnwindSafe for BacnetServer<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more