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 i8) -> &'a ImStr
pub unsafe fn from_ptr_unchecked<'a>(ptr: *const i8) -> &'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.
Trait Implementations§
impl Eq for ImStr
Source§impl PartialOrd for ImStr
impl PartialOrd for ImStr
impl StructuralPartialEq for ImStr
Auto Trait Implementations§
impl !Sized for ImStr
impl Freeze for ImStr
impl RefUnwindSafe for ImStr
impl Send for ImStr
impl Sync for ImStr
impl Unpin for ImStr
impl UnsafeUnpin for ImStr
impl UnwindSafe for ImStr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more