droid_wrap_utils

Struct JString

Source
pub struct JString<'local>(/* private fields */);
Expand description

Lifetime’d representation of a jstring. Just a JObject wrapped in a new class.

Implementations§

Source§

impl<'local> JString<'local>

Source

pub unsafe fn from_raw(raw: *mut _jobject) -> JString<'local>

Creates a JString that wraps the given raw jstring

§Safety

raw may be a null pointer. If raw is not a null pointer, then:

  • raw must be a valid raw JNI local reference.
  • There must not be any other JObject representing the same local reference.
  • The lifetime 'local must not outlive the local reference frame that the local reference was created in.
Source

pub fn into_raw(self) -> *mut _jobject

Unwrap to the raw jni type.

Methods from Deref<Target = JObject<'local>>§

Source

pub fn as_raw(&self) -> *mut _jobject

Returns the raw JNI pointer.

Trait Implementations§

Source§

impl<'local> AsRef<JObject<'local>> for JString<'local>

Source§

fn as_ref(&self) -> &JObject<'local>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'local> AsRef<JString<'local>> for JString<'local>

Source§

fn as_ref(&self) -> &JString<'local>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'local> Default for JString<'local>

Source§

fn default() -> JString<'local>

Returns the “default value” for a type. Read more
Source§

impl<'local> Deref for JString<'local>

Source§

type Target = JObject<'local>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<JString<'local> as Deref>::Target

Dereferences the value.
Source§

impl<'local, 'obj_ref> From<&'obj_ref JObject<'local>> for &'obj_ref JString<'local>

Source§

fn from(other: &'obj_ref JObject<'local>) -> &'obj_ref JString<'local>

Converts to this type from the input type.
Source§

impl<'local> From<JObject<'local>> for JString<'local>

Source§

fn from(other: JObject<'_>) -> JString<'local>

Converts to this type from the input type.
Source§

impl<'local> From<JString<'local>> for JObject<'local>

Source§

fn from(other: JString<'_>) -> JObject<'_>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'local> Freeze for JString<'local>

§

impl<'local> RefUnwindSafe for JString<'local>

§

impl<'local> Send for JString<'local>
where 'local: 'static,

§

impl<'local> Sync for JString<'local>
where 'local: 'static,

§

impl<'local> Unpin for JString<'local>

§

impl<'local> UnwindSafe for JString<'local>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'local, T> Desc<'local, T> for T
where T: AsRef<T>,

Source§

type Output = T

The type that this Desc returns.
Source§

fn lookup(self, _: &mut JNIEnv<'local>) -> Result<T, Error>

Look up the concrete type from the JVM. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.