#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

#910 in Text processing

Download history 65/week @ 2023-12-18 82/week @ 2023-12-25 127/week @ 2024-01-08 167/week @ 2024-01-15 274/week @ 2024-01-22 241/week @ 2024-01-29 198/week @ 2024-02-05 338/week @ 2024-02-12 213/week @ 2024-02-19 187/week @ 2024-02-26 173/week @ 2024-03-04 156/week @ 2024-03-11 263/week @ 2024-03-18 331/week @ 2024-03-25 315/week @ 2024-04-01

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