This commit fixes this by introducing a new StableIO
structure that implements both std::io::Read
, and std::io::Write
. The existing logic for StableWriter
and StableReader
is moved under this structure, andStableWriter
and StableReader
are reimplemented as wrappers around StableIO
.
The motivation for this approach was to allow backwards compatibility with existing API, while layering the new functionality/API on top.
This also fixes https://github.com/dfinity/cdk-rs/issues/334.
If you're interested, I can submit a PR.
Add 64-bit offset support for std::io traits #333
To make effective use of larger stable storage size, it would be useful to manipulate stable storage via
std::io::Read
andstd::io::Write
traits.