pub fn register_device_change_callback(callback: fn(DeviceChangeEvent)) {
        Monome::register_device_change_callback_with_host_and_port(
            std::net::IpAddr::V4(<Ipv4Addr>::LOCALHOST),
            SERIALOSC_PORT,
            callback,
        )
    }
/// Register for device added/removed notifications, on the default serialosc port, when it runs
/// on localhost.
///
/// # Arguments
///
/// - `callback`: a function that is called whenever a device is added or removed.
///
/// # Example
///
/// ```no_run
/// # use monome::Monome;
/// # use monome::DeviceChangeEvent;
/// Monome::register_device_change_callback(|event| {
///     match event {
///         DeviceChangeEvent::Added(id) => {
///             println!("Device {} added", id);
///         }
///         DeviceChangeEvent::Removed(id) => {
///             println!("Device {} removed", id);
///         }
///     }
/// });
/// ```
Register for device added/removed notifications, on the default serialosc port, when it runs
on localhost.
Register for device added / removed notifications on the default serialosc port when it runs on localhost .
pub fn register_device_change_callback(callback: fn(DeviceChangeEvent)) {
        Monome::register_device_change_callback_with_host_and_port(
            std::net::IpAddr::V4(<Ipv4Addr>::LOCALHOST),
            SERIALOSC_PORT,
            callback,
        )
    }
pub fn register_device_change_callback ( callback : fn ( DeviceChangeEvent ) ) { Monome :: register_device_change_callback_with_host_and_port ( std :: net :: IpAddr :: V4 ( < Ipv4Addr > :: LOCALHOST ) , SERIALOSC_PORT , callback , ) }
Register for device added/removed notifications, on the default serialosc port, when it runs
on localhost.
Register for device added / removed notifications on the default serialosc port when it runs on localhost .
callback
fn(DeviceChangeEvent)
callback
fn(DeviceChangeEvent)
a function that is called whenever a device is added or removed.
a function that is called whenever a device is added or removed .
example
None
use monome::monome;
None
use monome::devicechangeevent;
:register_device_change_callback(|event| {
match event {
DeviceChangeEvent::Added(id) => {
println!("Device {} added", id);
}
DeviceChangeEvent::Removed(id) => {
println!("Device {} removed", id);
}
}
});
```
: register_device_change_callback ( |event| { match event { DeviceChangeEvent :: Added ( id ) = > { println! ( " Device {} added " id ) ; } DeviceChangeEvent :: Removed ( id ) = > { println! ( " Device {} removed " id ) ; } } } ) ; ` ` `