pub fn device_unavailable(device: &mut Device, options: Options) -> Result<(), Error> {
    let next_boot_id = device.boot_id + 1;
    let mut message_builder = RequestBuilder::new(protocol::METHOD_NOTIFY);
    message_builder
        .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
        .add_header(protocol::HEAD_NT, &device.notification_type.to_string())
        .add_header(protocol::HEAD_NTS, protocol::NTS_BYE)
        .add_header(protocol::HEAD_USN, &device.service_name.to_string());

    if options.spec_version >= SpecVersion::V11 {
        message_builder
            .add_header(protocol::HEAD_BOOTID, &device.boot_id.to_string())
            .add_header(protocol::HEAD_CONFIGID, &device.config_id.to_string());
    }

    multicast_once(
        &message_builder.into(),
        &protocol::MULTICAST_ADDRESS.parse().unwrap(),
        &options.into(),
    )?;
    device.boot_id = next_boot_id;
    Ok(())
}
/**
Provides an implementation of the `ssdp:byebye` notification.

# Specification

When a device and its services are going to be removed from the network, the device SHOULD
multicast an `ssdp:byebye` message corresponding to each of the `ssdp:alive` messages it multicasted
that have not already expired. If the device is removed abruptly from the network, it might not be
possible to multicast a message. As a fallback, discovery messages MUST include an expiration
value in a `CACHE-CONTROL` field value (as explained above); if not re-advertised, the discovery
message eventually expires on its own.

When a device is about to be removed from the network, it should explicitly revoke its discovery
messages by sending one multicast request for each `ssdp:alive message` it sent. Each multicast
request must have method `NOTIFY` and `ssdp:byeby`e in the `NTS` header in the following format.

# Parameters

* `device` - details of the device to publish as a part of the notification message. Not all device
     fields may be used in all notifications.
* `options` - protocol options such as the specification version to use and any network
     configuration values.

*/
Provides an implementation of the `ssdp:byebye` notification.
Specification

When a device and its services are going to be removed from the network, the device SHOULD
multicast an `ssdp:byebye` message corresponding to each of the `ssdp:alive` messages it multicasted
that have not already expired. If the device is removed abruptly from the network, it might not be
possible to multicast a message. As a fallback, discovery messages MUST include an expiration
value in a `CACHE-CONTROL` field value (as explained above); if not re-advertised, the discovery
message eventually expires on its own.

When a device is about to be removed from the network, it should explicitly revoke its discovery
messages by sending one multicast request for each `ssdp:alive message` it sent.

Parameters

`device` - details of the device to publish as a part of the notification message. Not all device
fields may be used in all notifications.
`options` - protocol options such as the specification version to use and any network
configuration values.
Provides an implementation of the ` ssdp : byebye ` notification . Specification When a device and its services are going to be removed from the network the device SHOULD multicast an ` ssdp : byebye ` message corresponding to each of the ` ssdp : alive ` messages it multicasted that have not already expired . If the device is removed abruptly from the network it might not be possible to multicast a message . As a fallback discovery messages MUST include an expiration value in a ` CACHE - CONTROL ` field value ( as explained above ) ; if not re - advertised the discovery message eventually expires on its own . When a device is about to be removed from the network it should explicitly revoke its discovery messages by sending one multicast request for each ` ssdp : alive message ` it sent . Parameters ` device ` - details of the device to publish as a part of the notification message . Not all device fields may be used in all notifications . ` options ` - protocol options such as the specification version to use and any network configuration values .
pub fn device_unavailable(device: &mut Device, options: Options) -> Result<(), Error> {
    let next_boot_id = device.boot_id + 1;
    let mut message_builder = RequestBuilder::new(protocol::METHOD_NOTIFY);
    message_builder
        .add_header(protocol::HEAD_HOST, protocol::MULTICAST_ADDRESS)
        .add_header(protocol::HEAD_NT, &device.notification_type.to_string())
        .add_header(protocol::HEAD_NTS, protocol::NTS_BYE)
        .add_header(protocol::HEAD_USN, &device.service_name.to_string());
    if options.spec_version >= SpecVersion::V11 {
        message_builder
            .add_header(protocol::HEAD_BOOTID, &device.boot_id.to_string())
            .add_header(protocol::HEAD_CONFIGID, &device.config_id.to_string());
    }
    multicast_once(
        &message_builder.into(),
        &protocol::MULTICAST_ADDRESS.parse().unwrap(),
        &options.into(),
    )?;
    device.boot_id = next_boot_id;
    Ok(())
}
pub fn device_unavailable ( device : & mut Device , options : Options ) -> Result < ( ) , Error > { let next_boot_id = device . boot_id + 1 ; let mut message_builder = RequestBuilder :: new ( protocol :: METHOD_NOTIFY ) ; message_builder . add_header ( protocol :: HEAD_HOST , protocol :: MULTICAST_ADDRESS ) . add_header ( protocol :: HEAD_NT , & device . notification_type . to_string ( ) ) . add_header ( protocol :: HEAD_NTS , protocol :: NTS_BYE ) . add_header ( protocol :: HEAD_USN , & device . service_name . to_string ( ) ) ; if options . spec_version >= SpecVersion :: V11 { message_builder . add_header ( protocol :: HEAD_BOOTID , & device . boot_id . to_string ( ) ) . add_header ( protocol :: HEAD_CONFIGID , & device . config_id . to_string ( ) ) ; } multicast_once ( & message_builder . into ( ) , & protocol :: MULTICAST_ADDRESS . parse ( ) . unwrap ( ) , & options . into ( ) , ) ? ; device . boot_id = next_boot_id ; Ok ( ( ) ) }
Provides an implementation of the `ssdp:byebye` notification.
Provides an implementation of the ` ssdp : byebye ` notification .
device
&mut Device
options
Options
device
&mut Device
options
Options