[][src]Trait abistr::AsOptCStr

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

Treat self as a C-style string or null()

Safety

By implementing this trait, you promise that:

  • The returned pointer is either null(), or points to a \0-terminated string.
  • If pointing to a string, said string remains valid and immutable until self is dropped or a &mut self method is called.

Required methods

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

Returns a \0-terminated C string, or null().

Loading content...

Implementations on Foreign Types

impl AsOptCStr for ()[src]

impl<T: AsCStr> AsOptCStr for Option<T>[src]

Loading content...

Implementors

impl<'_> AsOptCStr for CStrPtr<'_>[src]

impl<T: AsCStr> AsOptCStr for T[src]

Loading content...