[−][src]Struct windows::HString
A WinRT string, sometimes called an HSTRING, is reference-counted and logically immutable. It should only be used for communicating with WinRT APIs.
Implementations
impl HString
[src]
pub fn new() -> Self
[src]
Create an empty HString
.
This function does no allocation.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the string is empty.
pub fn len(&self) -> usize
[src]
Returns the length of self
.
pub fn as_wide(&self) -> &[u16]ⓘ
[src]
Get the string as 16-bit wide characters (wchars).
pub fn from_wide(value: &[u16]) -> Self
[src]
Create a HString
from a slice of 16 bit characters (wchars).
pub fn to_string_lossy(&self) -> String
[src]
Get the contents of this HString
as a String lossily.
pub fn clear(&mut self)
[src]
Clear the contents of the string and free the memory if self
holds the
last reference to the string data.
Trait Implementations
impl Abi for HString
[src]
type Abi = RawPtr
pub unsafe fn set_abi(&mut self) -> *mut RawPtr
[src]
pub fn abi(&self) -> Self::Abi
[src]
pub unsafe fn from_abi(abi: Self::Abi) -> Result<Self>
[src]
impl Clone for HString
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HString
[src]
impl Default for HString
[src]
impl Display for HString
[src]
impl Drop for HString
[src]
impl From<&'_ String> for HString
[src]
impl From<&'_ str> for HString
[src]
impl From<String> for HString
[src]
impl PartialEq<&'_ str> for HString
[src]
pub fn eq(&self, other: &&str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<HString> for HString
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<String> for HString
[src]
pub fn eq(&self, other: &String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<str> for HString
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl RuntimeType for HString
[src]
type DefaultType = Self
pub const SIGNATURE: ConstBuffer
[src]
impl TryFrom<&'_ HString> for Object
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: &HString) -> Result<Self>
[src]
impl TryFrom<&'_ Object> for HString
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: &Object) -> Result<Self>
[src]
impl TryFrom<HString> for Object
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: HString) -> Result<Self>
[src]
impl TryFrom<Object> for HString
[src]
Auto Trait Implementations
impl RefUnwindSafe for HString
[src]
impl !Send for HString
[src]
impl !Sync for HString
[src]
impl Unpin for HString
[src]
impl UnwindSafe for HString
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,