pub enum FieldValue {
}Expand description
GFF Field value (value node inside a GFF Struct)
Variants§
Byte(u8)
Unsigned 8-bit integer
Char(i8)
Signed 8-bit integer
Word(u16)
Unsigned 16-bit integer
Short(i16)
Signed 16-bit integer
DWord(u32)
Unsigned 32-bit integer
Int(i32)
Signed 32-bit integer
DWord64(u64)
Unsigned 64-bit integer
Int64(i64)
Signed 64-bit integer
Float(f32)
32-bit floating point
Double(f64)
64-bit floating point
String(String)
String, with a length stored as a 32-bit unsigned integer
ResRef(String)
String, with a length stored as a 8-bit unsigned integer
LocString(LocString)
Localized strung
Void(Vec<u8>)
Raw data
Struct(Struct)
Struct containing other Fields
List(List)
List of Structs
Implementations§
Source§impl FieldValue
impl FieldValue
Sourcepub fn get_type_str(&self) -> &'static str
pub fn get_type_str(&self) -> &'static str
Returns a str representation of the stored type
Sourcepub fn to_string_pretty(&self, child_indent: &str) -> String
pub fn to_string_pretty(&self, child_indent: &str) -> String
Serializes this field to human-readable text
§Args:
- child_indent: prepend this str to each line after the first one
Sourcepub fn unwrap_byte(&self) -> u8
pub fn unwrap_byte(&self) -> u8
Unwraps stored byte value, panics if the field is not a byte
Sourcepub fn unwrap_char(&self) -> i8
pub fn unwrap_char(&self) -> i8
Unwraps stored char value, panics if the field is not a char
Sourcepub fn unwrap_word(&self) -> u16
pub fn unwrap_word(&self) -> u16
Unwraps stored word value, panics if the field is not a word
Sourcepub fn unwrap_short(&self) -> i16
pub fn unwrap_short(&self) -> i16
Unwraps stored short value, panics if the field is not a short
Sourcepub fn unwrap_dword(&self) -> u32
pub fn unwrap_dword(&self) -> u32
Unwraps stored dword value, panics if the field is not a dword
Sourcepub fn unwrap_int(&self) -> i32
pub fn unwrap_int(&self) -> i32
Unwraps stored int value, panics if the field is not a int
Sourcepub fn unwrap_dword64(&self) -> u64
pub fn unwrap_dword64(&self) -> u64
Unwraps stored dword64 value, panics if the field is not a dword64
Sourcepub fn unwrap_int64(&self) -> i64
pub fn unwrap_int64(&self) -> i64
Unwraps stored int64 value, panics if the field is not a int64
Sourcepub fn unwrap_float(&self) -> f32
pub fn unwrap_float(&self) -> f32
Unwraps stored float value, panics if the field is not a float
Sourcepub fn unwrap_double(&self) -> f64
pub fn unwrap_double(&self) -> f64
Unwraps stored double value, panics if the field is not a double
Sourcepub fn unwrap_string(&self) -> &String
pub fn unwrap_string(&self) -> &String
Unwraps stored string value, panics if the field is not a string
Sourcepub fn unwrap_resref(&self) -> &String
pub fn unwrap_resref(&self) -> &String
Unwraps stored resref value, panics if the field is not a resref
Sourcepub fn unwrap_locstring(&self) -> &LocString
pub fn unwrap_locstring(&self) -> &LocString
Unwraps stored locstring value, panics if the field is not a locstring
Sourcepub fn unwrap_void(&self) -> &Vec<u8> ⓘ
pub fn unwrap_void(&self) -> &Vec<u8> ⓘ
Unwraps stored void value, panics if the field is not a void
Sourcepub fn unwrap_struct(&self) -> &Struct
pub fn unwrap_struct(&self) -> &Struct
Unwraps stored struct value, panics if the field is not a struct
Sourcepub fn unwrap_list(&self) -> &Vec<Struct>
pub fn unwrap_list(&self) -> &Vec<Struct>
Unwraps stored list value, panics if the field is not a list