pub struct ContextedGlobal { /* private fields */ }
Expand description

GlobalRef along with it’s VM. Mainly to be used for thread traveling of objects.

Implementations§

source§

impl ContextedGlobal

source

pub fn from_local(env: &JNIEnv<'_>, local: JObject<'_>) -> Result<Self>

source

pub fn do_in_context_jret<'a: 'b, 'b, F>( &'a self, capacity: i32, f: F ) -> Result<ContextedGlobal>
where F: 'b + FnOnce(JNIEnv<'b>, JObject<'b>) -> Result<JObject<'b>>,

source

pub fn bind_locally<'a: 'b, 'b>( &self, env: &'b JNIEnv<'a> ) -> Result<JObject<'a>>

source

pub fn do_in_context_rret<F, R>(&self, capacity: i32, f: F) -> Result<R>
where F: FnOnce(JNIEnv<'_>, JObject<'_>) -> Result<R>,

source

pub fn with_safe_context_rret<F, R>( &self, capacity: i32, f: F ) -> GlobalResult<R>
where F: FnOnce(&JNIEnv<'_>, JObject<'_>) -> Result<R>,

source

pub async fn with_async_context<F>( &self, capacity: i32, f: F ) -> GlobalResult<ContextedGlobal>
where for<'a, 'b> F: FnOnce(&'b JNIEnv<'a>, JObject<'a>) -> Result<JCompletionStage<'a, 'b>>,

Trait Implementations§

source§

impl Clone for ContextedGlobal

source§

fn clone(&self) -> ContextedGlobal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ContextedGlobal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a: 'b, 'b> From<JCompletableFuture<'a, 'b>> for ContextedGlobal

source§

fn from(other: JCompletableFuture<'a, 'b>) -> ContextedGlobal

Converts to this type from the input type.
source§

impl<'a: 'b, 'b> From<JCompletionStage<'a, 'b>> for ContextedGlobal

source§

fn from(other: JCompletionStage<'a, 'b>) -> ContextedGlobal

Converts to this type from the input type.

Auto Trait Implementations§

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<'a, T> Desc<'a, T> for T

source§

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

Look up the concrete type from the JVM.
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<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.