[][src]Struct orbtk_render::utils::String16

pub struct String16 { /* fields omitted */ }

A UTF-16 encoded, growable string.

Examples

let mut string16 = String16::from("Übung"); string16.push('ä');

Implementations

impl String16[src]

pub fn new() -> String16[src]

Creates a new empty String16.

pub fn len(&self) -> usize[src]

Returns the length of this String16, in bytes.

Examples

Basic usage:

let a = String16::from("Übung");

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

pub fn as_bytes(&self) -> &[u16][src]

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

pub fn as_bytes_mut(&mut self) -> &mut [u16][src]

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

pub fn insert_str(&mut self, idx: usize, string: &str)[src]

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

pub fn push(&mut self, ch: char)[src]

Appends a given char onto the end of this String16.

pub fn remove(&mut self, idx: usize)[src]

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

pub fn is_empty(&self) -> bool[src]

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

pub fn ends_with(&self, pat: &str) -> bool[src]

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

pub fn clear(&mut self)[src]

Truncates this String16, removing all contents.

pub fn get_string(&self, start: usize, end: usize) -> Option<String>[src]

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

pub fn as_string(&self) -> String[src]

Converts the String16 value to a String.

Trait Implementations

impl Clone for String16[src]

impl Debug for String16[src]

impl Default for String16[src]

impl<'de> Deserialize<'de> for String16[src]

impl Display for String16[src]

impl<'_> From<&'_ str> for String16[src]

impl From<String> for String16[src]

impl PartialEq<String16> for String16[src]

impl Serialize for String16[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.