[][src]Function libcoap_sys::coap_new_str_const

pub unsafe extern "C" fn coap_new_str_const(
    data: *const u8,
    size: usize
) -> *mut coap_str_const_t

Returns a new const string object with at least size+1 bytes storage allocated, and the provided data copied into the string object. The string must be released using coap_delete_str_const().

@param data The data to put in the new string object. @param size The size to allocate for the binary string data.

@return A pointer to the new object or @c NULL on error.