An over-engineered Wake-on-LAN magic packet sender, written in Rust.
Go to file
Dustin 9b0fb35ed5 magic: Use an iterator to generate the byte stream
Instead of explicitly writing the byte array for the magic packet
content, the `MagicPacket.send` method now delegates to
`MagicPacketIterator`. It collects the values the iterator produces,
which are determined based on the number of times the `next` method has
been called, into a vector, and then passes a slice of that vector to
the `send` method of the UDP socket.

Using a vector of course requires allocating space on the heap, so while
this method is probably not as efficient as the previous stack-allocated
static array, it is certainly cleaner and easier to understand.
2018-08-16 22:59:55 -05:00
src magic: Use an iterator to generate the byte stream 2018-08-16 22:59:55 -05:00
.gitignore Initial commit 2018-08-14 22:09:15 -05:00
Cargo.lock Initial commit 2018-08-14 22:09:15 -05:00
Cargo.toml Initial commit 2018-08-14 22:09:15 -05:00