pub struct RecordNode { /* private fields */ }Expand description
A record node that contains other nodes as children.
Record nodes are the structural backbone of ESF files, organizing data into a hierarchical tree. Each record has a name (referencing the string table), a version number, and zero or more child nodes.
§Children Organization
Children can be organized in two ways depending on the HAS_NESTED_BLOCKS flag:
- Without nested blocks: Single flat list of children (
children[0]) - With nested blocks: Multiple groups of children, each group representing a logical grouping (e.g., multiple instances of the same record type)
§Example Structure
A typical ESF might have a structure like:
ROOT
├── CAMPAIGN_SAVE_GAME (record)
│ ├── FACTION (record, nested blocks for multiple factions)
│ │ ├── [Group 0: Faction 1 data...]
│ │ └── [Group 1: Faction 2 data...]
│ └── DATE (record)
│ ├── year (u32)
│ └── turn (u32)Implementations§
Source§impl RecordNode
impl RecordNode
Sourcepub fn record_flags(&self) -> &RecordNodeFlags
pub fn record_flags(&self) -> &RecordNodeFlags
Encoding flags controlling how this record is serialized.
Sourcepub fn version(&self) -> &u8
pub fn version(&self) -> &u8
Version number of this record’s schema (0-255). Used by the game to handle format changes across patches.
Source§impl RecordNode
impl RecordNode
Sourcepub fn record_flags_mut(&mut self) -> &mut RecordNodeFlags
pub fn record_flags_mut(&mut self) -> &mut RecordNodeFlags
Encoding flags controlling how this record is serialized.
Sourcepub fn version_mut(&mut self) -> &mut u8
pub fn version_mut(&mut self) -> &mut u8
Version number of this record’s schema (0-255). Used by the game to handle format changes across patches.
Sourcepub fn name_mut(&mut self) -> &mut String
pub fn name_mut(&mut self) -> &mut String
Name of the record (e.g., “FACTION”, “CAMPAIGN_SAVE_GAME”). This is resolved from the record names string table during decode.
Sourcepub fn children_mut(&mut self) -> &mut Vec<Vec<NodeType>>
pub fn children_mut(&mut self) -> &mut Vec<Vec<NodeType>>
Child nodes organized into groups.
- Without
HAS_NESTED_BLOCKS: Single group at index 0 - With
HAS_NESTED_BLOCKS: Multiple groups, each a separate logical unit
Source§impl RecordNode
impl RecordNode
Sourcepub fn set_record_flags(&mut self, val: RecordNodeFlags) -> &mut Self
pub fn set_record_flags(&mut self, val: RecordNodeFlags) -> &mut Self
Encoding flags controlling how this record is serialized.
Sourcepub fn set_version(&mut self, val: u8) -> &mut Self
pub fn set_version(&mut self, val: u8) -> &mut Self
Version number of this record’s schema (0-255). Used by the game to handle format changes across patches.
Sourcepub fn set_name(&mut self, val: String) -> &mut Self
pub fn set_name(&mut self, val: String) -> &mut Self
Name of the record (e.g., “FACTION”, “CAMPAIGN_SAVE_GAME”). This is resolved from the record names string table during decode.
Sourcepub fn set_children(&mut self, val: Vec<Vec<NodeType>>) -> &mut Self
pub fn set_children(&mut self, val: Vec<Vec<NodeType>>) -> &mut Self
Child nodes organized into groups.
- Without
HAS_NESTED_BLOCKS: Single group at index 0 - With
HAS_NESTED_BLOCKS: Multiple groups, each a separate logical unit
Trait Implementations§
Source§impl Clone for RecordNode
impl Clone for RecordNode
Source§fn clone(&self) -> RecordNode
fn clone(&self) -> RecordNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecordNode
impl Debug for RecordNode
Source§impl Default for RecordNode
impl Default for RecordNode
Source§fn default() -> RecordNode
fn default() -> RecordNode
Source§impl<'de> Deserialize<'de> for RecordNode
impl<'de> Deserialize<'de> for RecordNode
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>,
Source§impl PartialEq for RecordNode
impl PartialEq for RecordNode
Source§impl Serialize for RecordNode
impl Serialize for RecordNode
impl StructuralPartialEq for RecordNode
Auto Trait Implementations§
impl Freeze for RecordNode
impl RefUnwindSafe for RecordNode
impl Send for RecordNode
impl Sync for RecordNode
impl Unpin for RecordNode
impl UnsafeUnpin for RecordNode
impl UnwindSafe for RecordNode
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.