embedded-storage icon indicating copy to clipboard operation
embedded-storage copied to clipboard

Async capacity

Open avsaase opened this issue 1 year ago • 2 comments

Closes #37

Should the blocking version also be fallible?

avsaase avatar Jul 19 '24 19:07 avsaase

As I said in the issue, I am personally okay with this change.

Not sure about others? CC @lulf @Dirbaio @eldruin ?

MathiasKoch avatar Jul 25 '24 08:07 MathiasKoch

is this to support flashes where you query the size by doing e.g. an SPI operation which requires async?

I think in general it'd be better to read it in new() and cache it in a field, then .capacity() can just return that and needs no async. This'd probably help perf, especially if you're using the capacity in read/write/erase to do bounds checks, so you don't do an extra spi transaction to read the capacity every time.

Dirbaio avatar Jul 25 '24 09:07 Dirbaio