#[repr(transparent)]pub struct PCWSTR(pub *const u16);
Expand description
A pointer to a constant null-terminated string of 16-bit Unicode characters.
Tuple Fields§
§0: *const u16
Implementations§
source§impl PCWSTR
impl PCWSTR
sourcepub unsafe fn len(&self) -> usize
pub unsafe fn len(&self) -> usize
String length without the trailing 0
§Safety
The PCWSTR
’s pointer needs to be valid for reads up until and including the next \0
.
sourcepub unsafe fn is_empty(&self) -> bool
pub unsafe fn is_empty(&self) -> bool
Returns true
if the string length is zero, and false
otherwise.
§Safety
The PCWSTR
’s pointer needs to be valid for reads up until and including the next \0
.
sourcepub unsafe fn as_wide(&self) -> &[u16]
pub unsafe fn as_wide(&self) -> &[u16]
String data without the trailing 0
§Safety
The PCWSTR
’s pointer needs to be valid for reads up until and including the next \0
.
sourcepub unsafe fn to_string(&self) -> Result<String, FromUtf16Error>
pub unsafe fn to_string(&self) -> Result<String, FromUtf16Error>
sourcepub unsafe fn to_hstring(&self) -> HSTRING
pub unsafe fn to_hstring(&self) -> HSTRING
Trait Implementations§
impl Copy for PCWSTR
impl Eq for PCWSTR
impl StructuralPartialEq for PCWSTR
Auto Trait Implementations§
impl Freeze for PCWSTR
impl RefUnwindSafe for PCWSTR
impl !Send for PCWSTR
impl !Sync for PCWSTR
impl Unpin for PCWSTR
impl UnwindSafe for PCWSTR
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)