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

[1.x] Parse message function #216

Open
mulmarta opened this issue Nov 12, 2024 · 2 comments
Open

[1.x] Parse message function #216

mulmarta opened this issue Nov 12, 2024 · 2 comments

Comments

@mulmarta
Copy link
Contributor

mulmarta commented Nov 12, 2024

Background

Part of #211

Parse Message

We will have a function that parses an MLSMessage and outputs information needed to fetch the right data from storage.

pub enum MlsMessageDescription<'a> {
    Welcome {
        key_package_refs: &'a [KeyPackageRef],
        cipher_suite: CipherSuite,
    },
    ProtocolMessage {
        group_id: &'a [u8],
        epoch_id: u64,
        content_type: ContentType, // commit, proposal, or application
    },
    // Processing GroupInfo and KeyPackage does not require any storage
    GroupInfo,
    KeyPackage,
}

impl<'a> From<&'a MlsMessage> for MlsMessageDescription<'a> {
    ...
}

impl MlsMessage {
    fn description(&self) -> MlsMessageDescription  {
        ....
    }
}
@CaioSym
Copy link
Contributor

CaioSym commented Nov 19, 2024

Seems odd that we would need an object to own the conversion function. Would this have any major problems?

impl From<&MlsMessage> for ParsedMessage {
...
}

@mulmarta
Copy link
Contributor Author

Yes that's much better.

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

No branches or pull requests

2 participants