#[repr(transparent)]pub struct PWSTR(pub *mut u16);
Expand description
A pointer to a null-terminated string of 16-bit Unicode characters.
Tuple Fields§
§0: *mut u16
Implementations§
source§impl PWSTR
impl PWSTR
sourcepub unsafe fn len(&self) -> usize
pub unsafe fn len(&self) -> usize
String length without the trailing 0
§Safety
The PWSTR
’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 PWSTR
’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 PWSTR
’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 PWSTR
impl Eq for PWSTR
impl StructuralPartialEq for PWSTR
Auto Trait Implementations§
impl Freeze for PWSTR
impl RefUnwindSafe for PWSTR
impl !Send for PWSTR
impl !Sync for PWSTR
impl Unpin for PWSTR
impl UnwindSafe for PWSTR
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
)