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

How to use u32? #323

Open
icepng opened this issue Nov 16, 2022 · 1 comment
Open

How to use u32? #323

icepng opened this issue Nov 16, 2022 · 1 comment

Comments

@icepng
Copy link

icepng commented Nov 16, 2022

Just define u64 and i64 in Integer. How to read u32 in the serialization buffer?

pub enum Integer {
    /// Unsigned int representation
    Uint64(u64),
    /// Signed int representation
    Int64(i64),
}

// I try to read, just support u64?

let restored = Message::unpack(&mut cursor).expect("Message unpack failed");
restored.as_integer().expect("s").as_u64();

@shogo82148
Copy link

Your question is not about specification of MessagePack.
I recommend you to ask it at QA site such as StackOverflow.

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