Nowadays hypercore is defined for storage where errors are failure::Erroreg
This predates when Rust had std::error::Error trait, and could now be replaced with a Error + Send + Sync + 'static, such as anyhow, snafu or coreerror for a no_std crate.
This is also one less crate on the stack.
Motivation
This should help us move into no_std in the future, specially useful for WASM and embedded.
Guide-level explanation
We could replace failure with anyhow on random-access-disk and random-access-storage to use context during errors, which is also compatible with std::error::Error.
We can then define hypercore using the std Error trait, and broaden the types of Storageshypercore can use.
Reference-level explanation
Drawbacks
Increase min rust version (would be increased by #97 anyway)
Feature Request
Summary
Nowadays
hypercore
is defined for storage where errors arefailure::Error
egThis predates when Rust had
std::error::Error
trait, and could now be replaced with aError + Send + Sync + 'static
, such as anyhow, snafu or coreerror for ano_std
crate.This is also one less crate on the stack.
Motivation
This should help us move into
no_std
in the future, specially useful for WASM and embedded.Guide-level explanation
We could replace
failure
withanyhow
onrandom-access-disk
andrandom-access-storage
to use context during errors, which is also compatible withstd::error::Error
.We can then define
hypercore
using the stdError
trait, and broaden the types ofStorages
hypercore
can use.Reference-level explanation
Drawbacks
Rationale and alternatives
Unresolved Questions