[−][src]Struct winrt::HStringReference
A reference to either an HString
, a FastHString
, or a raw null-terminated UTF-16 buffer.
Methods
impl<'a> HStringReference<'a>
[src]
pub fn from_utf16(slice: &'a [u16]) -> HStringReference<'a>
[src]
Creates a new HStringReference
from a UTF-16 encoded slice, which must be null-terminated.
This function does not allocate and is the fastest option if you already have UTF-16 encoded
data.
Examples
Basic usage:
use winrt::HStringReference; let sparkle_heart = vec![0xD83D, 0xDC96, 0x0]; let r = HStringReference::from_utf16(&sparkle_heart); assert_eq!("💖", r.to_string());
pub unsafe fn from_utf16_unchecked(slice: &'a [u16]) -> HStringReference<'a>
[src]
Creates a new HStringReference
from a UTF-16 encoded slice, which must be null-terminated.
This function is unsafe because the caller must make sure that the data really is null-terminated.
pub fn len(&self) -> u32
[src]
Returns the length of the string in Unicode characters, as specified by WindowsGetStringLen
.
pub fn is_empty(&self) -> bool
[src]
Checks whether the string is empty.
Examples
Basic usage:
use winrt::HString; let s = HString::empty(); assert!(s.is_empty());
Methods from Deref<Target = HStringArg>
Trait Implementations
impl<'a> Ord for HStringReference<'a>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<'a> Eq for HStringReference<'a>
[src]
impl<'a> Clone for HStringReference<'a>
[src]
fn clone(&self) -> HStringReference<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> PartialOrd<HStringReference<'a>> for HStringReference<'a>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialEq<HStringReference<'a>> for HStringReference<'b>
[src]
fn eq(&self, other: &HStringReference) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<HString> for HStringReference<'a>
[src]
fn eq(&self, other: &HString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<HStringReference<'a>> for HString
[src]
fn eq(&self, other: &HStringReference) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<FastHString> for HStringReference<'a>
[src]
fn eq(&self, other: &FastHString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<HStringReference<'a>> for FastHString
[src]
fn eq(&self, other: &HStringReference) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> ToString for HStringReference<'a>
[src]
impl<'a> Copy for HStringReference<'a>
[src]
impl<'a> Display for HStringReference<'a>
[src]
impl<'a> Deref for HStringReference<'a>
[src]
Auto Trait Implementations
impl<'a> Send for HStringReference<'a>
impl<'a> Sync for HStringReference<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,