Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

der_derive: add DecodeValue, EncodeValue macros #1722

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dishmaker
Copy link
Contributor

@dishmaker dishmaker commented Mar 15, 2025

Fixes

Adds DecodeValue macro:

#[derive(DecodeValue)]
struct MyDecodeOnly {
    field: u8,
}
impl FixedTag for MyDecodeOnly {
    const TAG: Tag = Tag::Sequence;
}

and EncodeValue:

#[derive(EncodeValue)]
struct MyEncodeOnly {
    field: u8,
}
impl FixedTag for MyEncodeOnly {
    const TAG: Tag = Tag::Sequence;
}

@tarcieri
Copy link
Member

There aren't corresponding traits for these (and I don't think there should be).

Instead I would suggest making it possible to derive DecodeValue and EncodeValue

@dishmaker dishmaker changed the title der_derive: add SequenceDecode, SequenceEncode macros der_derive: add DecodeValue, EncodeValue macros Mar 15, 2025
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