7 releases

0.3.0 Oct 2, 2024
0.2.1 Feb 13, 2023
0.1.3 Dec 20, 2021
0.1.1 May 1, 2020
0.1.0 Apr 30, 2020

#394 in Rust patterns

Download history 741/week @ 2024-10-20 495/week @ 2024-10-27 941/week @ 2024-11-03 526/week @ 2024-11-10 870/week @ 2024-11-17 942/week @ 2024-11-24 1051/week @ 2024-12-01 778/week @ 2024-12-08 793/week @ 2024-12-15 87/week @ 2024-12-22 68/week @ 2024-12-29 520/week @ 2025-01-05 564/week @ 2025-01-12 377/week @ 2025-01-19 300/week @ 2025-01-26 466/week @ 2025-02-02

1,737 downloads per month
Used in 46 crates (2 directly)

CECILL-B

18KB
407 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