stable-structures icon indicating copy to clipboard operation
stable-structures copied to clipboard

Implement `BoundedStorable` for more data types

Open 0kenx opened this issue 2 years ago • 2 comments

 help: the following other types implement trait `BoundedStorable`:
              ()
              (A, B)

Would be nice to implement this for (A, B, C...) in accordance with candid.

0kenx avatar Jun 21 '23 15:06 0kenx

Also for Vec<T> and [T; N], where T is BoundedStorable and N: usize

0kenx avatar Jun 21 '23 15:06 0kenx

Would be nice to implement this for (A, B, C...) in accordance with candid.

I agree. We don't rely on candid for the (A, B) encoding though and neither should we for (A, B, C). If you have the cycles maybe this is something you'd like to contribute? :)

Also for Vec<T> and [T; N], where T is BoundedStorable and N: usize

Vec<T> is not bounded, so we cannot implement BoundedStorable for it. We already have a BoundedStorable implementation for [T; N] (see here)

ielashi avatar Jun 23 '23 11:06 ielashi