pub struct Uhppoted { /* private fields */ }

Implementations

Create a new Uhppote struct

Example:

use uhppote_rs::Uhppoted;
let uhppoted = UUhppoted::new(
    "0.0.0.0:0".parse().unwrap(),
    "255.255.255.255".parse().unwrap(),
    Duration::new(5, 0),
    Vec::new(),
    false,
)

Get all the available DeviceConfigs on the local network. This broadcasts a discovery message and waits Uhppoted::timeout for responses.

Get all the available Devices on the local network. This broadcasts a discovery message and waits Uhppoted::timeout for responses.

Get a Device by its device ID. This does not check if the device actually exists, but merely represents a device to interact with.

When ip_address is specified, communication will happen directly with the device. Otherwise, communication to the device will happen via local network broadcast.

Specify an ip_address when the device is not on the local network.

Listen for incoming Status messages from the UHPPOTE system on a specific address. Example:

use uhppote_rs::Uhppoted;
let uhppoted = Uhppoted::default();
let device = uhppoted.get_device(423196779);

let listener_address: SocketAddr = "192.168.0.10:12345".parse().unwrap();

device.set_listener(listener_address).unwrap();
uhppoted.listen(listener_address, |status| {
    println!("{:?}", status);
});

Trait Implementations

Formats the value using the given formatter. Read more

Creates a default instance of Uhppoted. Defaults:

  • bind: 0.0.0.0:0
  • broadcast: 255.255.255.255
  • listen: None
  • timeout: Duration::new(5, 0)
  • controllers: None

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.