[−][src]Struct jni_glue::StringChars
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,