6 releases

0.2.1 Feb 13, 2023
0.2.0 Feb 10, 2023
0.1.3 Dec 20, 2021
0.1.1 May 1, 2020
0.1.0 Apr 30, 2020

#15 in #borrowing

Download history 641/week @ 2024-03-13 750/week @ 2024-03-20 1453/week @ 2024-03-27 541/week @ 2024-04-03 626/week @ 2024-04-10 432/week @ 2024-04-17 549/week @ 2024-04-24 658/week @ 2024-05-01 495/week @ 2024-05-08 501/week @ 2024-05-15 866/week @ 2024-05-22 664/week @ 2024-05-29 550/week @ 2024-06-05 676/week @ 2024-06-12 685/week @ 2024-06-19 418/week @ 2024-06-26

2,412 downloads per month
Used in 37 crates (2 directly)

CECILL-B

17KB
394 lines

MownStr: Maybe Owned String

Latest Version Documentation Actions Status

This crate provides MownStr, a type for exchanging read-only strings that may be either borrowed or owned.

Contrarily to other types (such as for example Cow<str>), MownStr does not aim to be mutable nor generic, which allows it to be fast and lean.

Actually, a MownStr takes no more memory than a regular &str or Box<str>, and has a minimal runtime overhead. The drawback is that the maximum size of a MownStr is half the size of a regular str (which is still 8EiB on a 64-bit architectures...).

Supported Rust version

This crate targets the stable channel of rustc and cargo. I do not aim for compatibility with older versions, so new releases of mownstr may require you to upgrade your Rust toolchain.

No runtime deps