pub struct AutoLocal<'local, T>where
T: Into<JObject<'local>>,{ /* private fields */ }
Expand description
Auto-delete wrapper for local refs.
Anything passed to a foreign method and returned from JNI methods is considered a local ref
unless it is specified otherwise.
These refs are automatically deleted once the foreign method exits, but it’s possible that
they may reach the JVM-imposed limit before that happens.
This wrapper provides automatic local ref deletion when it goes out of
scope.
See also the JNI specification for details on referencing Java objects
and some extra information.
Creates a new auto-delete wrapper for a local ref.
Once this wrapper goes out of scope, the delete_local_ref
will be
called on the object. While wrapped, the object can be accessed via
the Deref
impl.
Forget the wrapper, returning the original object.
This prevents delete_local_ref
from being called when the AutoLocal
gets
dropped. You must either remember to delete the local ref manually, or
be
ok with it getting deleted once the foreign method returns.
Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter.
Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
The type that this Desc
returns.
Look up the concrete type from the JVM.
Read more
The type that this Desc
returns.
Look up the concrete type from the JVM.
Read more
Executes the destructor for this type.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.