#small #str #string

smallstr

String-like container based on smallvec

2 unstable releases

0.2.0 Jan 17, 2020
0.1.0 Apr 26, 2018

#6 in #small

Download history 5495/week @ 2021-10-03 4437/week @ 2021-10-10 5499/week @ 2021-10-17 7440/week @ 2021-10-24 4749/week @ 2021-10-31 6991/week @ 2021-11-07 6068/week @ 2021-11-14 4397/week @ 2021-11-21 5132/week @ 2021-11-28 5105/week @ 2021-12-05 5437/week @ 2021-12-12 4190/week @ 2021-12-19 4788/week @ 2021-12-26 5914/week @ 2022-01-02 7033/week @ 2022-01-09 7178/week @ 2022-01-16

25,007 downloads per month
Used in 44 crates (11 directly)

MIT/Apache

31KB
757 lines

smallstr

String-like container based on SmallVec

Documentation

Building

To include smallstr in your project, add the following to your Cargo.toml:

[dependencies]
smallstr = "0.2"

License

smallstr is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.


lib.rs:

Implements SmallString, a String-like container for small strings

no_std support

By default, smallstr does not depend on std. However, the ffi feature will add std as a dependency.

ffi feature

The ffi feature will add the following trait implementations to SmallString:

  • PartialEq<OsStr>
  • PartialEq<&'_ OsStr>
  • PartialEq<OsString>
  • PartialEq<Cow<'_, OsString>>

This feature also adds std as a dependency.

serde support

When the serde feature is enabled, the traits serde::Deserialize and serde::Serialize are implemented for SmallString.

This feature is disabled by default.

union feature

This feature will enable the union feature in smallvec, which reduces the size of a SmallString instance. This feature requires a nightly compiler.

Dependencies

~66KB

-"^