Expand packages and raw Engine write-up.

This commit is contained in:
Stephen Chung
2020-08-23 17:22:39 +08:00
parent 196e145c96
commit e2f271644a
10 changed files with 127 additions and 12 deletions

View File

@@ -378,7 +378,6 @@ pub struct Limits {
/// ```
///
/// Currently, `Engine` is neither `Send` nor `Sync`. Use the `sync` feature to make it `Send + Sync`.
#[derive(Clone)]
pub struct Engine {
/// A unique ID identifying this scripting `Engine`.
pub id: Option<String>,

View File

@@ -12,11 +12,11 @@ use crate::scope::Scope;
use crate::stdlib::{boxed::Box, string::ToString};
/// Trait to create a Rust anonymous function from a script.
/// Trait to create a Rust closure from a script.
pub trait Func<ARGS, RET> {
type Output;
/// Create a Rust anonymous function from an `AST`.
/// Create a Rust closure from an `AST`.
/// The `Engine` and `AST` are consumed and basically embedded into the closure.
///
/// # Examples
@@ -47,7 +47,7 @@ pub trait Func<ARGS, RET> {
/// # }
fn create_from_ast(self, ast: AST, entry_point: &str) -> Self::Output;
/// Create a Rust anonymous function from a script.
/// Create a Rust closure from a script.
/// The `Engine` is consumed and basically embedded into the closure.
///
/// # Examples