[][src]Struct orbtk::prelude::utils::String16

pub struct String16 { /* fields omitted */ }

A UTF-16 encoded, growable string.

Examples

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

Methods

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 string slice 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]

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<'_> IntoPropertySource<String16> for (&'_ str, Entity)[src]

impl IntoPropertySource<String16> for String[src]

impl IntoPropertySource<String16> for String16[src]

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

impl IntoPropertySource<String16> for (String, Entity)[src]

impl IntoPropertySource<String16> for Entity[src]

impl Debug for String16[src]

impl Default 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 StructuralPartialEq for String16[src]

impl Clone for String16[src]

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

impl<E> Component for E where
    E: Any
[src]

impl<T> SetParameter for T