pub struct HSTRING(/* private fields */);
Expand description
An (HSTRING) is a reference-counted and immutable UTF-16 string type.
Implementations§
Source§impl HSTRING
impl HSTRING
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of the string. The length is measured in u16
s (UTF-16 code units), not including the terminating null character.
Sourcepub fn from_wide(value: &[u16]) -> Result<HSTRING, Error>
pub fn from_wide(value: &[u16]) -> Result<HSTRING, Error>
Create a HSTRING
from a slice of 16 bit characters (wchars).
Sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Get the contents of this HSTRING
as a String lossily.
Sourcepub fn to_os_string(&self) -> OsString
pub fn to_os_string(&self) -> OsString
Get the contents of this HSTRING
as a OsString.
Trait Implementations§
Source§impl From<HStringBuilder> for HSTRING
impl From<HStringBuilder> for HSTRING
Source§fn from(value: HStringBuilder) -> HSTRING
fn from(value: HStringBuilder) -> HSTRING
Converts to this type from the input type.
Source§impl Ord for HSTRING
impl Ord for HSTRING
Source§impl PartialOrd for HSTRING
impl PartialOrd for HSTRING
impl Eq for HSTRING
impl Param<PCWSTR> for &HSTRING
impl Send for HSTRING
impl Sync for HSTRING
Auto Trait Implementations§
impl Freeze for HSTRING
impl RefUnwindSafe for HSTRING
impl Unpin for HSTRING
impl UnwindSafe for HSTRING
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
)