The `mac::ParseError` enumeration is intended to represent all of the
possible ways `MacAddress::from_string` could fail. For now, the only
known problem is an invalid hexadecimal integer found in one of the
octets, which causes a `ParseIntError`. The `ParseError` enum implements
the `Debug`, `Display`, and `Error` traits.
The `MacAddress` structure represents a 48-bit hardware address. Using a
dedicated type instead of an array will make it easier to validate
inputs and ensure type safety.
On the off chance that the magic packet needs to be sent to a
destination other than port 9 on the subnet-directed broadcast address,
the `send_to` method is now available on the `MagicPacket` structure.
The `send` method is retained, and now simply delegates to the `send_to`
method with a hard-coded socket address.
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.