null-terminated-str

Crates.ionull-terminated-str
lib.rsnull-terminated-str
version0.1.4
sourcesrc
created_at2022-09-05 10:37:18.17646
updated_at2022-09-16 06:46:46.693008
descriptionFFI-friendly utf-8 string, enabling const null-terminated str and caching of the non-terminated string to avoid frequent allocation.
homepage
repositoryhttps://github.com/NobodyXu/null-terminated-str
max_upload_size
id658744
size20,009
Jiahao XU (NobodyXu)

documentation

README

null-terminated-str

Rust

crate.io downloads

crate.io version

docs

Provides null terminated utf-8 str NullTerminatedStr (borrowed) and NullTerminatedString (owned) that is compatible with

  • std::ffi::CStr
  • std::ffi::CString
  • str
  • String

Also provides const_null_terminated_str! to create NullTerminatedStr at compile time and IntoNullTerminatedString that accepts &str, String, &NullTerminatedStr and NullTerminatedString to avoid frequent allocation in FFI call.

Commit count: 53

cargo fmt