mirror of
https://github.com/hexedtech/codemp.git
synced 2024-12-22 21:04:53 +01:00
chore: move ffi infos in root mod
because i actually dont want docs.rs to build with ffi flags anymore: docs get "littered" with napi auto methods and pyo3 stuff, which is annoying and needless noise when reading the doc. I would much rather only have relevant stuff, to not make doc consumers hop around guessing what is relevant and what not
This commit is contained in:
parent
d633884dbb
commit
c0b8906043
6 changed files with 31 additions and 31 deletions
|
@ -81,4 +81,4 @@ luajit = ["lua", "mlua-codemp-patch/luajit"]
|
|||
|
||||
|
||||
[package.metadata.docs.rs] # enabled features when building on docs.rs
|
||||
features = ["lua54", "java", "js", "python"]
|
||||
features = ["serialize"]
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
//! ### java
|
||||
//! Since for java it is necessary to deal with the JNI and no complete FFI library is available,
|
||||
//! java glue directly writes JNI functions leveraging [jni] rust bindings.
|
||||
//!
|
||||
//! To have a runnable `jar`, some extra Java code must be compiled (available under `dist/java`)
|
||||
//! and bundled together with the shared object. Such extra wrapper provides classes and methods
|
||||
//! loading the native extension and invoking the underlying native functions.
|
||||
|
||||
pub mod client;
|
||||
pub mod workspace;
|
||||
pub mod cursor;
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
//! ### javascript
|
||||
//! Using [napi] it's possible to map perfectly the entirety of `codemp` API.
|
||||
//! Async operations run on a dedicated [tokio] runtime and the result is sent back to main thread
|
||||
|
||||
pub mod client;
|
||||
pub mod workspace;
|
||||
pub mod cursor;
|
||||
|
|
|
@ -1,16 +1,3 @@
|
|||
//! ### Lua
|
||||
//! Using [mlua] it's possible to map almost perfectly the entirety of `codemp` API.
|
||||
//! Notable outliers are functions that receive `codemp` objects: these instead receive arguments
|
||||
//! to build the object instead (such as [`crate::api::Controller::send`])
|
||||
//!
|
||||
//! Note that async operations are carried out on a [tokio] current_thread runtime, so it is
|
||||
//! necessary to drive it. A separate driver thread can be spawned with `spawn_runtime_driver`
|
||||
//! function.
|
||||
//!
|
||||
//! To work with callbacks, the main Lua thread must periodically stop and poll for callbacks via
|
||||
//! `poll_callback`, otherwise those will never run. This is necessary to allow safe concurrent
|
||||
//! access to the global Lua state, so minimize callback execution time as much as possible.
|
||||
|
||||
use std::io::Write;
|
||||
use std::sync::Mutex;
|
||||
|
||||
|
|
|
@ -1,9 +1,38 @@
|
|||
//! ### FFI
|
||||
//! # FFI
|
||||
//! The glue code for FFI (Foreign Function Interface) in various languages, each gated behind
|
||||
//! a feature flag.
|
||||
//!
|
||||
//! For all except Java, the resulting shared object is ready to use, but external packages are
|
||||
//! available to simplify dependency management and provide type hints in editor.
|
||||
//!
|
||||
//! ## Lua
|
||||
//! Using [mlua](https://docs.rs/mlua) it's possible to map almost perfectly the entirety of `codemp` API.
|
||||
//! Notable outliers are functions that receive `codemp` objects: these instead receive arguments
|
||||
//! to build the object instead (such as [`crate::api::Controller::send`])
|
||||
//!
|
||||
//! Note that async operations are carried out on a [tokio] current_thread runtime, so it is
|
||||
//! necessary to drive it. A separate driver thread can be spawned with `spawn_runtime_driver`
|
||||
//! function.
|
||||
//!
|
||||
//! To work with callbacks, the main Lua thread must periodically stop and poll for callbacks via
|
||||
//! `poll_callback`, otherwise those will never run. This is necessary to allow safe concurrent
|
||||
//! access to the global Lua state, so minimize callback execution time as much as possible.
|
||||
//!
|
||||
//! ## Python
|
||||
//! Using [pyo3](https://docs.rs/pyo3) it's possible to map perfectly the entirety of `codemp` API.
|
||||
//! Async operations run on a dedicated [tokio] runtime
|
||||
//!
|
||||
//! ## JavaScript
|
||||
//! Using [napi](https://docs.rs/napi) it's possible to map perfectly the entirety of `codemp` API.
|
||||
//! Async operations run on a dedicated [tokio] runtime and the result is sent back to main thread
|
||||
//!
|
||||
//! ## Java
|
||||
//! Since for java it is necessary to deal with the JNI and no complete FFI library is available,
|
||||
//! java glue directly writes JNI functions leveraging [jni](https://docs.rs/jni) rust bindings.
|
||||
//!
|
||||
//! To have a runnable `jar`, some extra Java code must be compiled (available under `dist/java`)
|
||||
//! and bundled together with the shared object. Such extra wrapper provides classes and methods
|
||||
//! loading the native extension and invoking the underlying native functions.
|
||||
|
||||
/// java bindings, built with [jni]
|
||||
#[cfg(feature = "java")]
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
//! ### python
|
||||
//! Using [pyo3] it's possible to map perfectly the entirety of `codemp` API.
|
||||
//! Async operations run on a dedicated [tokio] runtime
|
||||
|
||||
pub mod client;
|
||||
pub mod controllers;
|
||||
pub mod workspace;
|
||||
|
|
Loading…
Reference in a new issue