pub trait HavokSort {
type Error;
// Required methods
fn sort_for_bytes(&mut self);
fn sort_for_xml(&mut self) -> Result<usize, Self::Error>;
}
Expand description
Trait that provides a method that can be used to sort bytes and XML to serialize
Required Associated Types§
Required Methods§
Sourcefn sort_for_bytes(&mut self)
fn sort_for_bytes(&mut self)
Sort by dependent class from root for serialization of bytes.
There is a rule that binary data serializes class dependency pointers in order from the root, which is hkRootLevelContainer
.
This is because behavior is written by state transitions, which are state machines.
§Current implementation
- If deserialize a binary with
serde-hkx
-> already sorted for bytes - If deserialize xml of official SDK -> sort is required