[][src]Struct jni_glue::StringChars

pub struct StringChars<'env> { /* fields omitted */ }

Represents an env.GetStringChars + env.GetStringLength query. Will automatically env.ReleaseStringChars when dropped.

Methods

impl<'env> StringChars<'env>[src]

pub unsafe fn from_env_jstring(env: &'env Env, string: jstring) -> Self[src]

Construct a StringChars from an Env + jstring.

pub fn chars(&self) -> &[jchar][src]

Get an array of jchars. Generally UTF16, but not guaranteed to be valid UTF16.

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

Get an array of u16s. Generally UTF16, but not guaranteed to be valid UTF16.

pub fn decode(&self) -> DecodeUtf16<Cloned<Iter<u16>>>[src]

std::char::decode_utf16(...)s these string characters.

pub fn to_string(&self) -> Result<String, DecodeUtf16Error>[src]

Returns a new Ok(String), or an Err(DecodeUtf16Error) if if it contained any invalid UTF16.

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

Returns a new String with any invalid UTF16 characters replaced with REPLACEMENT_CHARACTERs ('\u{FFFD}'.)

Trait Implementations

impl<'env> Drop for StringChars<'env>[src]

Auto Trait Implementations

impl<'env> RefUnwindSafe for StringChars<'env>

impl<'env> !Send for StringChars<'env>

impl<'env> !Sync for StringChars<'env>

impl<'env> Unpin for StringChars<'env>

impl<'env> UnwindSafe for StringChars<'env>

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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.