Struct arcdps_imgui::ImStr
source · pub struct ImStr(/* private fields */);
Expand description
A UTF-8 encoded, implicitly nul-terminated string slice.
Implementations§
source§impl ImStr
impl ImStr
sourcepub unsafe fn from_ptr_unchecked<'a>(ptr: *const c_char) -> &'a ImStr
pub unsafe fn from_ptr_unchecked<'a>(ptr: *const c_char) -> &'a ImStr
Wraps a raw UTF-8 encoded C string
§Safety
It is up to the caller to guarantee the pointer is not null and it points to a null-terminated UTF-8 string valid for the duration of the arbitrary lifetime ’a.
sourcepub unsafe fn from_utf8_with_nul_unchecked(bytes: &[u8]) -> &ImStr
pub unsafe fn from_utf8_with_nul_unchecked(bytes: &[u8]) -> &ImStr
Converts a slice of bytes to an imgui-rs string slice without checking for valid UTF-8 or null termination.
§Safety
It is up to the caller to guarantee the slice contains valid UTF-8 and a null terminator.
sourcepub unsafe fn from_cstr_unchecked(value: &CStr) -> &ImStr
pub unsafe fn from_cstr_unchecked(value: &CStr) -> &ImStr
Converts a CStr reference to an imgui-rs string slice without checking for valid UTF-8.
§Safety
It is up to the caller to guarantee the CStr reference contains valid UTF-8.