pub enum NodeType {
Show 39 variants
Invalid,
Bool(BoolNode),
I8(i8),
I16(i16),
I32(I32Node),
I64(i64),
U8(u8),
U16(u16),
U32(U32Node),
U64(u64),
F32(F32Node),
F64(f64),
Coord2d(Coordinates2DNode),
Coord3d(Coordinates3DNode),
Utf16(String),
Ascii(String),
Angle(i16),
Unknown21(u32),
Unknown23(u8),
Unknown24(u16),
Unknown25(u32),
Unknown26(Vec<u8>),
BoolArray(Vec<bool>),
I8Array(Vec<u8>),
I16Array(Vec<i16>),
I32Array(VecI32Node),
I64Array(Vec<i64>),
U8Array(Vec<u8>),
U16Array(Vec<u16>),
U32Array(VecU32Node),
U64Array(Vec<u64>),
F32Array(Vec<f32>),
F64Array(Vec<f64>),
Coord2dArray(Vec<Coordinates2DNode>),
Coord3dArray(Vec<Coordinates3DNode>),
Utf16Array(Vec<String>),
AsciiArray(Vec<String>),
AngleArray(Vec<i16>),
Record(Box<RecordNode>),
}Expand description
Represents all possible node types in an ESF file.
ESF files use a tagged union approach where each node in the binary format starts with a type marker byte that identifies what kind of data follows. This enum mirrors that structure.
§Categories
- Primitive nodes: Single values (bool, integers, floats, strings)
- Optimized nodes: Primitives with compact encoding tracking (
BoolNode,I32Node, etc.) - Complex nodes: Structured data like coordinates
- Array nodes: Collections of same-typed values
- Record nodes: Container nodes with named children
- Unknown nodes: Undocumented types preserved for round-trip fidelity
Note: Some type information was originally extracted from ESFEdit.
Variants§
Invalid
Invalid/uninitialized node. Used as a placeholder; encountering this during parsing or encoding indicates an error.
Bool(BoolNode)
Boolean value with optimization tracking.
I8(i8)
Signed 8-bit integer.
I16(i16)
Signed 16-bit integer.
I32(I32Node)
Signed 32-bit integer with optimization tracking.
I64(i64)
Signed 64-bit integer.
U8(u8)
Unsigned 8-bit integer.
U16(u16)
Unsigned 16-bit integer.
U32(U32Node)
Unsigned 32-bit integer with optimization tracking.
U64(u64)
Unsigned 64-bit integer.
F32(F32Node)
32-bit floating point with optimization tracking.
F64(f64)
64-bit floating point.
Coord2d(Coordinates2DNode)
2D coordinate (x, y as f32).
Coord3d(Coordinates3DNode)
3D coordinate (x, y, z as f32).
Utf16(String)
UTF-16 encoded string (stored as index, resolved during decode).
Ascii(String)
ASCII/UTF-8 encoded string (stored as index, resolved during decode).
Angle(i16)
Angle value stored as i16.
Unknown21(u32)
Unknown type 0x21 storing a u32 value.
Unknown23(u8)
Unknown type 0x23 storing a u8 value.
Unknown24(u16)
Unknown type 0x24 storing a u16 value.
Unknown25(u32)
Unknown type 0x25 storing a u32 value.
Unknown26(Vec<u8>)
Unknown type 0x26 with variable-length data (Three Kingdoms DLC).
BoolArray(Vec<bool>)
Array of boolean values.
I8Array(Vec<u8>)
Array of i8 values (stored as u8 for efficiency).
I16Array(Vec<i16>)
Array of i16 values.
I32Array(VecI32Node)
Array of i32 values with optimization tracking.
I64Array(Vec<i64>)
Array of i64 values.
U8Array(Vec<u8>)
Array of u8 values (raw bytes).
U16Array(Vec<u16>)
Array of u16 values.
U32Array(VecU32Node)
Array of u32 values with optimization tracking.
U64Array(Vec<u64>)
Array of u64 values.
F32Array(Vec<f32>)
Array of f32 values.
F64Array(Vec<f64>)
Array of f64 values.
Coord2dArray(Vec<Coordinates2DNode>)
Array of 2D coordinates.
Coord3dArray(Vec<Coordinates3DNode>)
Array of 3D coordinates.
Utf16Array(Vec<String>)
Array of UTF-16 strings.
AsciiArray(Vec<String>)
Array of ASCII strings.
AngleArray(Vec<i16>)
Array of angle values.
Record(Box<RecordNode>)
Record node - a named container holding child nodes. Records form the hierarchical structure of ESF files.
Implementations§
Source§impl NodeType
impl NodeType
Sourcepub fn clone_without_children(&self) -> Self
pub fn clone_without_children(&self) -> Self
Creates a copy of a node without its children (for record nodes).
For record nodes, this creates a new record with the same name, flags,
and version but with an empty children list. For all other node types,
this is equivalent to clone().
Useful for building modified node trees while preserving the structure.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeType
impl<'de> Deserialize<'de> for NodeType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for NodeType
Auto Trait Implementations§
impl Freeze for NodeType
impl RefUnwindSafe for NodeType
impl Send for NodeType
impl Sync for NodeType
impl Unpin for NodeType
impl UnsafeUnpin for NodeType
impl UnwindSafe for NodeType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.