Struct windy::AStr[][src]

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

Represents a borrowed ANSI string.

Implementations

Returns the length of bytes.

Returns true if the length of bytes is 0.

Creates String from AStr.

Creates String from AStr.

Creates AString from AStr.

Converts AStr to WString.

Returns ConvertError::ConvertToUnicodeError if an input cannot be converted to a wide char.

Example

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

Converts AStr to WString.

Example

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

Creates a new &AStr from bytes.

Safety

bytes must be a correct ANSI string.

Creates a new mut &AStr from bytes.

Safety

bytes must be a correct ANSI string.

Creates &AStr from ptr.

Safety

ptr must be a null-terminated ANSI string.

Creates &AStr from ptr and len.

Safety

ptr must be a null-terminated ANSI string.

Creates &AStr from ptr and len without length check.

Safety

ptr must be a null-terminated ANSI string.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

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

Converts the given value to a String. Read more

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