ic-stable-memory icon indicating copy to clipboard operation
ic-stable-memory copied to clipboard

SVec to &[u8]

Open pu0238 opened this issue 2 years ago • 0 comments

Hi in my case i need to get &[u8] from SVec. I n typical Vec i would do &&Vec but with SVec i tryed blob.as_dyn_size_bytes() and to get typical vec blob.iter().map(|el| *el).collect::<Vec<_>>();.

In first case I got error that i have shape [256, 24] insted of [u8] in second Reject text: Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped: stable memory out of bounds.

How can i get [u8] from SVec or Typical Vec from SVec

pu0238 avatar Oct 22 '23 21:10 pu0238