pub unsafe fn from_c_str(ptr: *mut c_char)
            -> Result<Malloc<str>, Utf8Error> {
        let len = libc::strlen(ptr);
        let slice = slice::from_raw_parts(ptr as *mut u8, len);
        str::from_utf8(slice).map(|s| {
            Malloc { ptr: s as *const str as *mut str }
        })
    }
/**
    Constructs a new `Malloc` for a `malloc`'d nul-terminated C string
    at the given pointer. Returns an error if the bytes are not valid UTF8.

    Unsafe because `ptr` must point to valid, nul-terminated bytes.

    Once created, when dereferenced the `Malloc<str>` will return the string
    without its nul-terminator.
    */
Constructs a new `Malloc` for a `malloc`'d nul-terminated C string
at the given pointer. Returns an error if the bytes are not valid UTF8.

Unsafe because `ptr` must point to valid, nul-terminated bytes.

Once created, when dereferenced the `Malloc` will return the string
without its nul-terminator.
Constructs a new ` Malloc ` for a ` malloc ` ' d nul - terminated C string at the given pointer . Returns an error if the bytes are not valid UTF8 . Unsafe because ` ptr ` must point to valid nul - terminated bytes . Once created when dereferenced the ` Malloc ` will return the string without its nul - terminator .
pub unsafe fn from_c_str(ptr: *mut c_char)
            -> Result<Malloc<str>, Utf8Error> {
        let len = libc::strlen(ptr);
        let slice = slice::from_raw_parts(ptr as *mut u8, len);
        str::from_utf8(slice).map(|s| {
            Malloc { ptr: s as *const str as *mut str }
        })
    }
pub unsafe fn from_c_str ( ptr : * mut c_char ) -> Result < Malloc < str > , Utf8Error > { let len = libc :: strlen ( ptr ) ; let slice = slice :: from_raw_parts ( ptr as * mut u8 , len ) ; str :: from_utf8 ( slice ) . map ( | s | { Malloc { ptr : s as * const str as * mut str } } ) }
Constructs a new `Malloc` for a `malloc`'d nul-terminated C string
at the given pointer.
Constructs a new ` Malloc ` for a ` malloc ` ' d nul - terminated C string at the given pointer .
ptr
*mut c_char