#string #c-str #ffi #compile-time

null-terminated-str

FFI-friendly utf-8 string, enabling const null-terminated str and caching of the non-terminated string to avoid frequent allocation

5 releases

0.1.4 Sep 16, 2022
0.1.3 Sep 14, 2022
0.1.2 Sep 5, 2022
0.1.1 Sep 5, 2022
0.1.0 Sep 5, 2022

#8 in #c-str

Download history 14/week @ 2024-07-01 59/week @ 2024-07-08 61/week @ 2024-07-15 91/week @ 2024-07-22 98/week @ 2024-07-29 57/week @ 2024-08-05 26/week @ 2024-08-12 17/week @ 2024-08-19 39/week @ 2024-08-26 10/week @ 2024-09-02 21/week @ 2024-09-09 20/week @ 2024-09-16 57/week @ 2024-09-23 49/week @ 2024-09-30 42/week @ 2024-10-07 24/week @ 2024-10-14

174 downloads per month
Used in 8 crates (2 directly)

MIT license

18KB
366 lines

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.

Dependencies

~175KB