Skip to content

how to unpack [ 146, 0, 203, 66, 120, 167, 66, 234, 244, 144, 0, ] #14

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

Open
xxaier opened this issue Sep 8, 2023 · 1 comment
Open

Comments

@xxaier
Copy link

xxaier commented Sep 8, 2023

I use https://github.com/kriszyp/msgpackr gen this msgpack

I try use codx-dev/msgpacker unpack
[ 146, 0, 203, 66, 120, 167, 66, 234, 244, 144, 0, ]

I use this code unpack

    #[derive(MsgPacker)]
    pub struct IdLi {
      pub id_li: Vec<u64>,
    }

    pub async fn run(uid: u64, channel_id: String, body: &[u8]) -> Result<()> {
      dbg!(&body);
      let id_li = IdLi::unpack(&body)?.1.id_li;
       dbg!(id_li);
      Ok(())
    }

get UnexpectedFormatTag

@computermouth
Copy link

You're suffering the same problem as I am here: #18

This library doesn't expect an array delimiter at the beginning of the stream if you're doing a <T>::unpack(). If you trim your first byte, probably it works.

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