Struct advent_of_code_2021::day_16::Packet [−][src]
struct Packet {
version: usize,
packet_type: PacketType,
sub_packets: Vec<Packet>,
value: usize,
}Expand description
Represents a packet in BITS
Fields
version: usizeThe version (0-7)
packet_type: PacketTypeIndicates what this packet represents
sub_packets: Vec<Packet>List of sub-packets. For PacketType::Literal this will be empty
value: usizeThe literal value, for PacketTypes other than PacketType::Literal
Implementations
Solution to part one. Returns the sum of this packet’s version and the version sum of all sub-packets
