Struct winrt::HStringReference [] [src]

pub struct HStringReference<'a>(_, _);

A reference to either an HString, a FastHString, or a raw null-terminated UTF-16 buffer.

Methods

impl<'a> 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());

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.

Returns the length of the string in Unicode characters, as specified by WindowsGetStringLen.

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> Copy for HStringReference<'a>
[src]

impl<'a> Clone for HStringReference<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Display for HStringReference<'a>
[src]

Formats the value using the given formatter.

impl<'a> PartialOrd for HStringReference<'a>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> Ord for HStringReference<'a>
[src]

This method returns an Ordering between self and other. Read more

impl<'a, 'b> PartialEq<HStringReference<'a>> for HStringReference<'b>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Eq for HStringReference<'a>
[src]

impl<'a> Deref for HStringReference<'a>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a> PartialEq<HString> for HStringReference<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> PartialEq<FastHString> for HStringReference<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.