[][src]Trait abistr::AsCStr

pub unsafe trait AsCStr {
    pub fn as_cstr(&self) -> *const c_char;
}

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

pub fn as_cstr(&self) -> *const c_char[src]

Returns a \0-terminated C string

Loading content...

Implementations on Foreign Types

impl<'_> AsCStr for &'_ CStr[src]

impl AsCStr for CString[src]

Loading content...

Implementors

impl<'_> AsCStr for CStrNonNull<'_>[src]

Loading content...