Struct windy::WString[][src]

#[repr(C)]
pub struct WString { /* fields omitted */ }
Expand description

Represents a wide string (Unicode string).

Implementations

Returns &WStr.

Returns &mut WStr.

Returns the length of bytes.

Returns true if the length of bytes is 0.

Creates WString from Vec without any encoding checks.

Safety

v must be a correct Unicode string.

Creates WString from Vec without any encoding checks.

Safety

v must be a correct Unicode string.

Creates WString from v without a null-terminated check and any encoding checks.

Safety

v must be a null-terminated Unicode string.

Converts &str to WString.

Example

use windy::WString;
let s = WString::from_str("test🍣").unwrap();
println!("{:?}", s);

Converts &str to WString.

Example

use windy::WString;
let s = WString::from_str_lossy("test🍣");
println!("{:?}", s);

Creates WString from ptr.

Safety

ptr must be a null-terminated Unicode string.

Creates WString from ptr and len.

Safety

ptr must be a null-terminated Unicode string.

Creates WString from ptr and len without length check.

Safety

ptr must be a null-terminated Unicode string.

Methods from Deref<Target = WStr>

Returns the length of bytes.

Returns true if the length of bytes is 0.

Converts WString to UTF-8 string.

If an input has an invalid character, this function returns ConvertError::ConvertToUtf8Error.

Converts WStr to UTF-8 string.

The function replaces Illegal sequences with with \u{FFFD}.

Creates WString from WStr.

Converts WStr to AString.

Example

use windy::{AString, WString};
let s = AString::from_str("test").unwrap();
let s2 = WString::from_str("test").unwrap().to_astring().unwrap();
assert_eq!(s, s2);

Converts WStr to AString.

Example

use windy::{AString, WString};
let s = AString::from_str("test").unwrap();
let s2 = WString::from_str("test").unwrap().to_astring_lossy();
assert_eq!(s, s2);

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.