pub unsafe trait AsCStr<C = i8> {
    fn as_cstr(&self) -> *const C;
}
Expand description

Treat self as a C-style string

Safety

By implementing this trait, you promise that:

  • The returned pointer points to a valid \0-terminated string.
  • Said string remains valid and immutable until self is dropped or a &mut self method is called.

Required methods

Returns a \0-terminated C string

Implementations on Foreign Types

Implementors