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

#404 in Rust patterns

Download history 652/week @ 2024-11-13 801/week @ 2024-11-20 1143/week @ 2024-11-27 1019/week @ 2024-12-04 686/week @ 2024-12-11 496/week @ 2024-12-18 39/week @ 2024-12-25 256/week @ 2025-01-01 627/week @ 2025-01-08 419/week @ 2025-01-15 354/week @ 2025-01-22 323/week @ 2025-01-29 599/week @ 2025-02-05 416/week @ 2025-02-12 367/week @ 2025-02-19 372/week @ 2025-02-26

1,847 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