Skip to content

Change stack from failure to std::error::Error #101

@bltavares

Description

@bltavares

Feature Request

Summary

Nowadays hypercore is defined for storage where errors are failure::Error eg

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 Storages hypercore can use.

Reference-level explanation

Drawbacks

Rationale and alternatives

Unresolved Questions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions