Struct winrt::FastHString [] [src]

pub struct FastHString(_);

A string type that should be used to create strings that can be passed to Windows Runtime functions. Creating a new FastHString is faster than creating an instance of HString because it eliminates an additional allocation. Furthermore, obtaining a HStringArg from a FastHString is basically free, which is not the case for HString.

Methods

impl FastHString
[src]

Creates a new FastHString from a Rust string. FastHString uses the Rust allocator to create a storage buffer for its contents, where the string is stored in UTF-16 encoding. The buffer is freed on when the FastHString is dropped.

Examples

Basic usage:

use winrt::FastHString;
let s = FastHString::new("hello");
assert_eq!("hello", s.to_string());

Creates an empty FastHString.

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

Examples

Basic usage:

use winrt::FastHString;
let s = FastHString::new("hello");
assert_eq!(5, s.len());

Checks whether the string is empty.

Examples

Basic usage:

use winrt::FastHString;
let s = FastHString::empty();
assert!(s.is_empty());

Creates an HStringReference that points to the contents of this FastHString.

Examples

Basic usage:

use winrt::FastHString;
let s = FastHString::new("hello");
let r = s.make_reference();  
assert_eq!("hello", r.to_string());

Methods from Deref<Target=HStringArg>

Trait Implementations

impl Drop for FastHString
[src]

A method called when the value goes out of scope. Read more

impl<'a> From<&'a str> for FastHString
[src]

Performs the conversion.

impl Display for FastHString
[src]

Formats the value using the given formatter.

impl PartialOrd for FastHString
[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 Ord for FastHString
[src]

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

impl PartialEq<FastHString> for FastHString
[src]

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

This method tests for !=.

impl Eq for FastHString
[src]

impl<'a> Deref for FastHString
[src]

The resulting type after dereferencing

The method called to dereference a value

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

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

This method tests for !=.

impl PartialEq<HString> for FastHString
[src]

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

This method tests for !=.