Struct imgui::ImStr[][src]

#[repr(transparent)]pub struct ImStr(_);

A UTF-8 encoded, implicitly nul-terminated string slice.

Implementations

impl ImStr[src]

pub unsafe fn from_ptr_unchecked<'a>(ptr: *const c_char) -> &'a ImStr[src]

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.

pub unsafe fn from_utf8_with_nul_unchecked(bytes: &[u8]) -> &ImStr[src]

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.

pub unsafe fn from_cstr_unchecked(value: &CStr) -> &ImStr[src]

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.

pub fn as_ptr(&self) -> *const c_char[src]

Converts an imgui-rs string slice to a raw pointer

pub fn to_str(&self) -> &str[src]

Converts an imgui-rs string slice to a normal string slice

pub fn is_empty(&self) -> bool[src]

Returns true if the imgui-rs string slice is empty

Trait Implementations

impl AsRef<CStr> for ImStr[src]

impl AsRef<ImStr> for ImString[src]

impl AsRef<ImStr> for ImStr[src]

impl AsRef<str> for ImStr[src]

impl Borrow<ImStr> for ImString[src]

impl Debug for ImStr[src]

impl<'a> Default for &'a ImStr[src]

impl Display for ImStr[src]

impl Eq for ImStr[src]

impl Hash for ImStr[src]

impl Ord for ImStr[src]

impl PartialEq<ImStr> for ImStr[src]

impl PartialOrd<ImStr> for ImStr[src]

impl StructuralEq for ImStr[src]

impl StructuralPartialEq for ImStr[src]

impl ToOwned for ImStr[src]

type Owned = ImString

The resulting type after obtaining ownership.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]