#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

#872 in Text processing

Download history 260/week @ 2024-01-27 200/week @ 2024-02-03 197/week @ 2024-02-10 357/week @ 2024-02-17 181/week @ 2024-02-24 169/week @ 2024-03-02 160/week @ 2024-03-09 235/week @ 2024-03-16 324/week @ 2024-03-23 244/week @ 2024-03-30 253/week @ 2024-04-06 279/week @ 2024-04-13 337/week @ 2024-04-20 110/week @ 2024-04-27 247/week @ 2024-05-04 162/week @ 2024-05-11

886 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

~180KB