Skip to content

Serde decoding fails with subkeys #49

Closed
@lars-berger

Description

@lars-berger

When decoding via the serialization-serde feature, it fails with DecodeNotImplemented("deserialize_any for keys") even though I'm only interested in certain values (eg. AutoColorization only in this case).

#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct DesktopReg {
  AutoColorization: u32,
}

pub fn decode_example() -> Result<DesktopReg> {
  let hkcu = RegKey::predef(HKEY_CURRENT_USER);
  let desktop_key = hkcu.open_subkey_with_flags("Control Panel\\Desktop", KEY_READ)?;
  
  let decoded: DesktopReg = desktop_key.decode()?;
  Ok(decoded)
}

Activity

gentoo90

gentoo90 commented on Feb 17, 2023

@gentoo90
Owner

Fixed in winreg-0.11.0.

PS: on my machine there's no AutoColorization value in this registry key, so you might want to use Option<u32>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gentoo90@lars-berger

        Issue actions

          Serde decoding fails with subkeys · Issue #49 · gentoo90/winreg-rs