BurntSushi / BurntSushi/bstr

Support for `databake`, `writeable`, `zerovec` traits?

Open
#183 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.1k
Forks
77
PR merge metrics
No merged PRs in 30d

Description

The `bstr` crate has an optional dependency on `serde` to add Serialize/Deserialize impls.

Would you accept a pull request adding implementations of the following traits behind optional, non-default features?

- [databake](https://docs.rs/databake/0.1.7/databake/index.html)::[Bake](https://docs.rs/databake/0.1.7/databake/trait.Bake.html#)
- [writeable](https://docs.rs/writeable/latest/writeable/index.html)::[Writeable](https://docs.rs/writeable/latest/writeable/trait.Writeable.html#) or the soon-to-be-released [TryWriteable](https://unicode-org.github.io/icu4x/rustdoc/writeable/trait.TryWriteable.html#)
- [zerovec](https://docs.rs/zerovec/latest/zerovec/index.html)::[ule](https://docs.rs/zerovec/latest/zerovec/ule/index.html)::[VarULE](https://docs.rs/zerovec/latest/zerovec/ule/trait.VarULE.html#)
- [zerovec](https://docs.rs/zerovec/latest/zerovec/index.html)::[maps](https://docs.rs/zerovec/latest/zerovec/maps/index.html)::[ZeroMapKV](https://docs.rs/zerovec/latest/zerovec/maps/trait.ZeroMapKV.html#)

Both of these crates live in the `icu4x` repository but are intended to be used outside the context of icu4x.

I believe `bstr` depending on `databake`, `writeable`, and `zerovec` is the correct direction: `bstr` defines a concrete type that implements the traits exported from `databake`, `writeable`, and `zerovec`, which implement the traits on standard library types.

One risk of the dependency going in this direction is that we haven't released these crates at 1.0 yet, so the traits may be subject to change, which can make it annoying on the `bstr` side. We could alternatively consider a dependency going in the other direction, at least to start, and then switch the dependency direction when we reach 1.0 of `zerovec` and `writeable`.

CC @Manishearth @hsivonen

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing bstr's optional serde dependency and feature configuration, then read the linked databake, writeable, and zerovec trait documentation. Determine whether the proposed implementations and dependency direction are still acceptable given the traits' pre-1.0 status; done means an agreed scope and a pull request adding the selected optional integrations.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.