[−][src]Enum j4rs::InvocationArg
Struct that carries an argument that is used for method invocations in Java.
Variants
An arg that is created in the Java world.
A serialized arg that is created in the Rust world.
An non-serialized arg created in the Rust world, that contains a Java instance.
The instance is a Basic Java type, like Integer, Float, String etc.
Methods
impl InvocationArg
[src]
pub fn new<T>(arg: &T, class_name: &str) -> InvocationArg where
T: Serialize + Any,
[src]
T: Serialize + Any,
Creates a InvocationArg::Rust. This is default for the Args that are created from the Rust code.
pub fn new_2<T>(
arg: &T,
class_name: &str,
jni_env: *mut JNIEnv
) -> Result<InvocationArg> where
T: Serialize + Any,
[src]
arg: &T,
class_name: &str,
jni_env: *mut JNIEnv
) -> Result<InvocationArg> where
T: Serialize + Any,
pub fn into_primitive(self) -> Result<InvocationArg>
[src]
Consumes this InvocationArg and transforms it to an InvocationArg that contains a Java primitive, leveraging Java's autoboxing.
This action can be done by calling Jvm::cast
of Instances as well (e.g.: jvm.cast(&instance, "int"))
but calling into_primitive
is faster, as it does not involve JNI calls.
pub fn as_java_ptr(&self, jni_env: *mut JNIEnv) -> Result<jobject>
[src]
Creates a jobject
from this InvocationArg.
pub fn instance(self) -> Result<Instance>
[src]
Consumes this invocation arg and returns its Instance
Trait Implementations
impl From<Instance> for InvocationArg
[src]
fn from(instance: Instance) -> InvocationArg
[src]
impl Serialize for InvocationArg
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'a> TryFrom<&'a [&'a str]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [&'a str]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [String]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [String]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [bool]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [bool]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [char]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [char]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [f32]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [f32]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [f64]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [f64]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [i16]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [i16]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [i32]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [i32]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [i64]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [i64]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a [i8]> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: &'a [i8]) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a String> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a String) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a bool> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a bool) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a char> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a char) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a f32> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a f32) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a f64> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a f64) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a i16> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a i16) -> Result<InvocationArg>
[src]
impl<'a, 'b> TryFrom<&'a i32> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a i32) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a i64> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a i64) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a i8> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a i8) -> Result<InvocationArg>
[src]
impl<'a> TryFrom<&'a str> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: &'a str) -> Result<InvocationArg>
[src]
impl<'a, T: 'static> TryFrom<(&'a [T], &'a str)> for InvocationArg where
T: Serialize,
[src]
T: Serialize,
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(vec: (&'a [T], &'a str)) -> Result<InvocationArg>
[src]
impl TryFrom<()> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: ()) -> Result<InvocationArg>
[src]
impl TryFrom<String> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: String) -> Result<InvocationArg>
[src]
impl TryFrom<bool> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: bool) -> Result<InvocationArg>
[src]
impl TryFrom<char> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: char) -> Result<InvocationArg>
[src]
impl TryFrom<f32> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: f32) -> Result<InvocationArg>
[src]
impl TryFrom<f64> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: f64) -> Result<InvocationArg>
[src]
impl TryFrom<i16> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: i16) -> Result<InvocationArg>
[src]
impl TryFrom<i32> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: i32) -> Result<InvocationArg>
[src]
impl TryFrom<i64> for InvocationArg
[src]
type Error = J4RsError
The type returned in the event of a conversion error.
fn try_from(arg: i64) -> Result<InvocationArg>
[src]
impl TryFrom<i8> for InvocationArg
[src]
Auto Trait Implementations
impl RefUnwindSafe for InvocationArg
impl Send for InvocationArg
impl !Sync for InvocationArg
impl Unpin for InvocationArg
impl UnwindSafe for InvocationArg
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,