pub struct Object(/* private fields */);Expand description
java.lang.Object
The bottom type for all java::Classes, as well as the target
for java::Object casts.
Implementations§
Source§impl Object
impl Object
Sourcepub fn is_instance_of<T>(&self, e: &mut Env<'_>) -> boolwhere
T: Type,
pub fn is_instance_of<T>(&self, e: &mut Env<'_>) -> boolwhere
T: Type,
Is this object instanceof C?
Sourcepub fn upcast_to<T>(self, e: &mut Env<'_>) -> Twhere
T: Object,
pub fn upcast_to<T>(self, e: &mut Env<'_>) -> Twhere
T: Object,
Shorthand for T::upcast(e, jobj)
Sourcepub fn new_reference(&self, e: &mut Env<'_>) -> Self
pub fn new_reference(&self, e: &mut Env<'_>) -> Self
Create a new global reference to the same object
Sourcepub fn to_value<'a>(&self, e: &mut Env<'a>) -> JValueGen<JObject<'a>>
pub fn to_value<'a>(&self, e: &mut Env<'a>) -> JValueGen<JObject<'a>>
Convert an object reference to an owned local jvalue
Sourcepub fn to_local<'a>(&self, e: &mut Env<'a>) -> JObject<'a>
pub fn to_local<'a>(&self, e: &mut Env<'a>) -> JObject<'a>
Convert an object reference to an owned local jobject
Sourcepub fn into_global(self) -> GlobalRef
pub fn into_global(self) -> GlobalRef
Unwrap an object’s inner global reference
Sourcepub fn from_value<'a, 'b>(e: &mut Env<'a>, jv: JValueGen<JObject<'b>>) -> Selfwhere
'a: 'b,
pub fn from_value<'a, 'b>(e: &mut Env<'a>, jv: JValueGen<JObject<'b>>) -> Selfwhere
'a: 'b,
Convert an owned local jvalue to an object
Sourcepub fn from_value_ref<'a, 'b, 'c>(
e: &mut Env<'a>,
jv: JValueGen<&'c JObject<'b>>,
) -> Selfwhere
'a: 'b,
'c: 'b,
pub fn from_value_ref<'a, 'b, 'c>(
e: &mut Env<'a>,
jv: JValueGen<&'c JObject<'b>>,
) -> Selfwhere
'a: 'b,
'c: 'b,
Convert a borrowed local jvalue to an object
Sourcepub fn from_local<'a, 'b, T>(e: &mut Env<'a>, t: T) -> Self
pub fn from_local<'a, 'b, T>(e: &mut Env<'a>, t: T) -> Self
Convert a local jobject to an object
Sourcepub fn from_global(t: GlobalRef) -> Self
pub fn from_global(t: GlobalRef) -> Self
Convert a global reference to an object
Sourcepub fn as_value(&self) -> JValueGen<&JObject<'static>>
pub fn as_value(&self) -> JValueGen<&JObject<'static>>
Convert an object reference to a borrowed local JValue
Trait Implementations§
Source§impl Object for Object
impl Object for Object
Source§fn downcast_ref(&self, e: &mut Env<'_>) -> Object
fn downcast_ref(&self, e: &mut Env<'_>) -> Object
Create an object reference from
&selfSource§fn upcast_value_ref<'e>(e: &mut Env<'e>, jv: JValue<'e, '_>) -> Selfwhere
Self: Sized,
fn upcast_value_ref<'e>(e: &mut Env<'e>, jv: JValue<'e, '_>) -> Selfwhere
Self: Sized,
Try to interpret a
JValue as SelfSource§fn upcast_value<'e>(e: &mut Env<'e>, jv: JValueOwned<'e>) -> Selfwhere
Self: Sized,
fn upcast_value<'e>(e: &mut Env<'e>, jv: JValueOwned<'e>) -> Selfwhere
Self: Sized,
Try to interpret a
JValueOwned as SelfSource§fn downcast_value<'e>(self, e: &mut Env<'e>) -> JValueOwned<'e>where
Self: Sized,
fn downcast_value<'e>(self, e: &mut Env<'e>) -> JValueOwned<'e>where
Self: Sized,
Create a
JValueOwned from selfSource§fn yield_to_java(&self, e: &mut Env<'_>) -> jobject
fn yield_to_java(&self, e: &mut Env<'_>) -> jobject
Use this to yield ownership of a
java::lang::Object
to the JVM, for example when returning a jobject from a
native function.Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F, A, TF, T> Sequence<F, A, TF> for T
impl<F, A, TF, T> Sequence<F, A, TF> for T
Source§fn sequence<Ap>(self) -> <Ap as HKT1>::T<<F as HKT1>::T<A>>where
Self: Sized + Traversable<F, <Ap as HKT1>::T<A>, A, TF> + Foldable<F, <Ap as HKT1>::T<A>>,
Ap: HKT1,
<Ap as HKT1>::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>,
<Ap as HKT1>::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>,
<Ap as HKT1>::T<<F as HKT1>::T<A>>: Applicative<Ap, <F as HKT1>::T<A>> + ApplyOnce<Ap, <F as HKT1>::T<A>>,
F: HKT1<T<<Ap as HKT1>::T<A>> = Self>,
fn sequence<Ap>(self) -> <Ap as HKT1>::T<<F as HKT1>::T<A>>where
Self: Sized + Traversable<F, <Ap as HKT1>::T<A>, A, TF> + Foldable<F, <Ap as HKT1>::T<A>>,
Ap: HKT1,
<Ap as HKT1>::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>,
<Ap as HKT1>::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>,
<Ap as HKT1>::T<<F as HKT1>::T<A>>: Applicative<Ap, <F as HKT1>::T<A>> + ApplyOnce<Ap, <F as HKT1>::T<A>>,
F: HKT1<T<<Ap as HKT1>::T<A>> = Self>,
See
Sequence