Enum abxml::model::Value

source ·
pub enum Value {
Show 14 variants StringReference(u32), Dimension(String), Fraction(String), Float(f32), Integer(u32), Flags(u32), Boolean(bool), ColorARGB8(String), ColorRGB8(String), ColorARGB4(String), ColorRGB4(String), ReferenceId(u32), AttributeReferenceId(u32), Unknown(u8u32),
}
Expand description

Represents a value on the binary documents. It is formed by a type and a 32 bits payload. The payloads are interpreted depending on the type.

Variants

StringReference(u32)

Represents an index on a StringTable

Dimension(String)

Represents a dimension. Bits [31..8] represents the numeric value. Bits [7..4] is an index on a lookup table that modified the numeric value. Bits [3..0] is an index on a dimensions lookup table

Fraction(String)

Represents a fraction. Bits [31..8] represents the numeric value. Bits [7..4] seems to be unused. Bits [3..0] is an index on a units lookup table

Float(f32)

Represents a float value

Integer(u32)

Represents an integer value

Flags(u32)

Integer value that should be interpreted as a bit flag array

Boolean(bool)

Represents a boolean value

ColorARGB8(String)

Represents a ARGB8 color

ColorRGB8(String)

Represents a RGB8 color

ColorARGB4(String)

Represents a ARGB4 color

ColorRGB4(String)

Represents a RGB4 color

ReferenceId(u32)

Represents a reference to an Entry

AttributeReferenceId(u32)

Represents a reference to an Entry on attribute context

Unknown(u8u32)

Unknown value. It saves the type and the payload in case that needs to be checked

Implementations

Creates a new Value. If the payload can not be interpreted by the given value_type, it will return an error. If the type is not know, it will return Value::Unknown

Trait Implementations

Formats the value using the given formatter. Read more
Converts the given value to a String. Read more

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.