Trait HavokSort

Source
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§

Source

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
Source

fn sort_for_xml(&mut self) -> Result<usize, Self::Error>

Sort by dependent class for XML serialization.

§Return

top ptr

§Errors

Missing top pointer.

Implementations on Foreign Types§

Source§

impl<V> HavokSort for IndexMap<usize, V>
where V: HavokClass,

Implementors§