Skip to main content

Primitive

Trait Primitive 

Source
pub trait Primitive
where Self: Type + Sized + Copy,
{ type PrimitiveWrapper: Class; // Required methods fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper; fn from_primitive_wrapper( e: &mut Env<'_>, w: Self::PrimitiveWrapper, ) -> Self; fn from_jvalue_ref(jv: JValue<'_, '_>) -> Self; fn from_jvalue(jv: JValueOwned<'_>) -> Self; fn into_jvalue<'local>(self) -> JValueOwned<'local>; }
Expand description

Primitive java values that can be cheaply converted to / from JValue and can be wrapped by an Object class.

Required Associated Types§

Source

type PrimitiveWrapper: Class

The Object type that this type may be wrapped with

Required Methods§

Source

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Create a new instance of Self::PrimitiveWrapper from a copy of self

Source

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Perform the inverse conversion, yielding Self from Self::PrimitiveWrapper

Source

fn from_jvalue_ref(jv: JValue<'_, '_>) -> Self

Convert a local JValue reference to Self

Source

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Convert an owned local JValue to Self

Source

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Convert self to a JValue

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Primitive for bool

Source§

type PrimitiveWrapper = Bool

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> bool

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for f32

Source§

type PrimitiveWrapper = Float

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> f32

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for f64

Source§

type PrimitiveWrapper = Double

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> f64

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for i8

Source§

type PrimitiveWrapper = Byte

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> i8

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for i16

Source§

type PrimitiveWrapper = Short

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> i16

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for i32

Source§

type PrimitiveWrapper = Integer

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> i32

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for i64

Source§

type PrimitiveWrapper = Long

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> i64

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Source§

impl Primitive for u16

Source§

type PrimitiveWrapper = Char

Source§

fn to_primitive_wrapper(&self, e: &mut Env<'_>) -> Self::PrimitiveWrapper

Source§

fn from_primitive_wrapper(e: &mut Env<'_>, w: Self::PrimitiveWrapper) -> Self

Source§

fn from_jvalue_ref(jv: JValue<'_, '_>) -> u16

Source§

fn from_jvalue(jv: JValueOwned<'_>) -> Self

Source§

fn into_jvalue<'local>(self) -> JValueOwned<'local>

Implementors§