Enum advent_of_code_2021::day_16::PacketType[−][src]

enum PacketType {
    Sum,
    Product,
    Min,
    Max,
    Literal,
    GreaterThan,
    LessThan,
    Equal,
}
Expand description

The eight possible packet types

Variants

Sum

Operation: Sum all contained packets

Product

Operation: Multiply all contained packets

Min

Operation: Return the minimum of all contained packets

Max

Operation: Return the maximum of all contained packets

Literal

Literal: This packet represents a literal number value

GreaterThan

Operation: Compare the first and only two sub packets, returns 1 if first is greater than second, 0 otherwise.

LessThan

Operation: Compare the first and only two sub packets, returns 1 if first is less than second, 0 otherwise.

Equal

Operation: Compare the first and only two sub packets, returns 1 if first is equal to second, 0 otherwise.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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.