jvm 0.3.0

Core abstractions and runtime services for embeddable JVM implementations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use alloc::{borrow::Cow, boxed::Box};
use core::fmt::Debug;

use jvm_types::MethodAccessFlags;

use crate::{JavaValue, Jvm, Result, as_any::AsAny};

#[async_trait::async_trait]
pub trait Method: Sync + Send + AsAny + Debug {
    fn name(&self) -> Cow<'_, str>;
    fn descriptor(&self) -> Cow<'_, str>;
    fn access_flags(&self) -> MethodAccessFlags;

    async fn run(&self, jvm: &Jvm, args: Box<[JavaValue]>) -> Result<JavaValue>;
}