pub struct String16 { /* private fields */ }
Expand description

A UTF-16 encoded, growable string.

Examples

let mut string16 = String16::from(“Übung”); string16.push(‘ä’);

Implementations

Creates a new empty String16.

Returns the length of this String16, in bytes.

Examples

Basic usage:

let a = String16::from(“Übung”);

assert_eq!(a.len(), 5);

Returns a slice of u16s bytes that were attempted to convert to a String.

Returns a mutable slice of u16s bytes that were attempted to convert to a String.

Inserts a string slice into this String16 at a byte position.

Appends a given char onto the end of this String16.

Removes a char from this String16 at a byte position and returns it.

Returns true if this String16 has a length of zero, and false otherwise.

Returns true if this String16 ends with the given string slice, or false otherwise.

Truncates this String16, removing all contents.

Returns a string part begins with the startand ends with the end index.

Converts the String16 value to a String.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.