pub struct KeyMapping {
pub version: String,
/* private fields */
}Expand description
Bidirectional key mapping for NMS save file deobfuscation.
Maps obfuscated 3-character keys (e.g., "F2P") to readable names
(e.g., "Version").
Fields§
§version: StringVersion string from the primary mapping file.
Implementations§
Source§impl KeyMapping
impl KeyMapping
Sourcepub fn bundled() -> Self
pub fn bundled() -> Self
Load the bundled (compiled-in) mapping.
Merges all three mapping sources:
mapping_mbincompiler.json(primary)mapping_legacy.json(older keys)mapping_savewizard.json(name fixups)
Sourcepub fn from_json(json: &str) -> Result<Self, SaveError>
pub fn from_json(json: &str) -> Result<Self, SaveError>
Load a mapping from a JSON string (single mapping file).
Sourcepub fn get(&self, obfuscated: &str) -> Option<&str>
pub fn get(&self, obfuscated: &str) -> Option<&str>
Look up the readable name for an obfuscated key.
Sourcepub fn deobfuscate(&self, value: &mut Value)
pub fn deobfuscate(&self, value: &mut Value)
Deobfuscate all keys in a serde_json::Value tree in place.
Walks the tree recursively. For each JSON object, replaces obfuscated keys with their readable equivalents. Unknown keys are preserved as-is. After key replacement, applies any fixups (e.g., case corrections).
Trait Implementations§
Source§impl Clone for KeyMapping
impl Clone for KeyMapping
Source§fn clone(&self) -> KeyMapping
fn clone(&self) -> KeyMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KeyMapping
impl RefUnwindSafe for KeyMapping
impl Send for KeyMapping
impl Sync for KeyMapping
impl Unpin for KeyMapping
impl UnsafeUnpin for KeyMapping
impl UnwindSafe for KeyMapping
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
Mutably borrows from an owned value. Read more