[][src]Struct jstring::JavaString

pub struct JavaString { /* fields omitted */ }

JavaString uses short string optimizations and a lack of a "capacity" field to reduce struct size and heap fragmentation in certain cases.

It allows for mutation, but not for growth without reallocation.

Methods

impl JavaString[src]

pub const fn new() -> Self[src]

Creates a new empty JavaString.

Given that the JavaString is empty, this will not allocate any initial buffer.

Examples

Basic usage:

let s = JavaString::new();

pub const fn with_capacity(_len: usize) -> Self[src]

Creates a new empty JavaString. Included for API compatibility with standard String implementation.

Examples

Basic usage:

let mut s = String::with_capacity(10);

Trait Implementations

impl DerefMut for JavaString[src]

impl Deref for JavaString[src]

type Target = str

The resulting type after dereferencing.

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, 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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