pub struct MagicPacket { /* private fields */ }
Expand description

A Wake-on-LAN magic packet.

Implementations§

Creates a new MagicPacket intended for mac_address (but doesn’t send it yet).

Sends the magic packet via UDP to the broadcast address 255.255.255.255:9. Lets the operating system choose the source port and network interface.

Sends the magic packet via UDP to/from an IP address and port number of your choosing.

Returns the magic packet’s payload (6 repetitions of 0xFF and 16 repetitions of the target device’s MAC address). Send these bytes yourself over the network if you want to do something more advanced (like reuse a single UDP socket when sending a large number of magic packets).

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.