mownstr

Crates.iomownstr
lib.rsmownstr
version0.3.0
sourcesrc
created_at2020-04-30 17:01:27.262316
updated_at2024-10-02 15:30:53.201057
descriptionMaybe Owned String
homepage
repositoryhttps://github.com/pchampin/mownstr
max_upload_size
id235885
size22,541
Pierre-Antoine Champin (pchampin)

documentation

https://docs.rs/mownstr

README

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.

Commit count: 29

cargo fmt