Trait lrs::string::AsCStr

Objects that can be interpreted as CStrs.

Syntax

trait AsCStr : ToCStr + AsRef<[u8]> {
    /* Required methods */
    fn as_cstr(&self) -> Result<&CStr, Errno>
}

Methods

ReceiverNameDescription
&selfas_cstr

Borrows the object as a CStr.

Remarks

This operation can fail if the object has interior null bytes, e.g., "Hello World\0\0\0" will succeed but "Hello\0World\0" will fail.