-
Notifications
You must be signed in to change notification settings - Fork 127
Closed as duplicate of#165
Description
Hello, is it possible to implement MaxSize for heapless::Vec? I found that Se/De traits are already implemented, but MaxSize does not:
My Cargo.toml:
heapless = {version = "0.8.0", features = ["serde"] }
postcard = { version = "1", features = ["experimental-derive", "use-defmt", "heapless"] }My structs:
#[derive(Serialize, Deserialize, Clone, Debug, Format, MaxSize)]
pub struct A<const N: usize> {
pub value: Vec<u8, N>
}Error log:
error[E0277]: the trait bound `Vec<u8, N>: MaxSize` is not satisfied
--> /Users/haobogu/Projects/keyboard/rmk/rmk/src/event.rs:29:16
|
29 | pub value: Vec<u8, N>
| ^^^^^^^^^^ the trait `MaxSize` is not implemented for `Vec<u8, N>`
|
= help: the following other types implement trait `MaxSize`:
&T
&mut T
()
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
and 41 others
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels