Struct windows_core::HSTRING
pub struct HSTRING(/* private fields */);
Expand description
A WinRT string (HSTRING) is reference-counted and immutable.
Implementations§
§impl HSTRING
impl HSTRING
pub const fn new() -> Self
pub const fn new() -> Self
Create an empty HSTRING
.
This function does not allocate memory.
pub 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.
pub fn from_wide(value: &[u16]) -> Result<Self>
pub fn from_wide(value: &[u16]) -> Result<Self>
Create a HSTRING
from a slice of 16 bit characters (wchars).
pub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Get the contents of this HSTRING
as a String lossily.
pub fn to_os_string(&self) -> OsString
pub fn to_os_string(&self) -> OsString
Get the contents of this HSTRING
as a OsString.
Trait Implementations§
§impl Ord for HSTRING
impl Ord for HSTRING
§impl PartialOrd for HSTRING
impl PartialOrd for HSTRING
§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl TryFrom<&HSTRING> for IInspectable
impl TryFrom<&HSTRING> for IInspectable
§impl TryFrom<&IInspectable> for HSTRING
impl TryFrom<&IInspectable> for HSTRING
§impl TryFrom<HSTRING> for IInspectable
impl TryFrom<HSTRING> for IInspectable
§impl TryFrom<IInspectable> for HSTRING
impl TryFrom<IInspectable> for HSTRING
impl Eq for HSTRING
impl Send for HSTRING
impl Sync for HSTRING
Auto Trait Implementations§
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