Skip to content

Conversation

@dishmaker
Copy link
Contributor

use der::{Any, Decode, Reader};

/// Wrapper around Any, with custom foreign trait support.
///
/// For example: serde Serialize/Deserialize
pub struct AnySerde(pub Any);

impl<'a> Decode<'a> for AnySerde {
    type Error = der::Error;

    fn decode<R: Reader<'a>>(reader: &mut R) -> der::Result<Self> {
        // calls impl Decode for Any
        Ok(Self(Any::decode(reader)?))
    }
}

@baloo baloo merged commit be8bde3 into RustCrypto:master Oct 10, 2025
107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants