Refine currying docs.

This commit is contained in:
Stephen Chung
2020-07-23 15:49:09 +08:00
parent dc7f847a8e
commit 1a48a2d8ba
3 changed files with 36 additions and 34 deletions

View File

@@ -17,7 +17,7 @@ use crate::stdlib::{
sync::Arc,
};
/// A general function trail object.
/// A general expression evaluation trait object.
#[cfg(not(feature = "sync"))]
pub type FnCustomSyntaxEval = dyn Fn(
&Engine,
@@ -25,12 +25,13 @@ pub type FnCustomSyntaxEval = dyn Fn(
&mut Scope,
&[Expression],
) -> Result<Dynamic, Box<EvalAltResult>>;
/// A general function trail object.
/// A general expression evaluation trait object.
#[cfg(feature = "sync")]
pub type FnCustomSyntaxEval = dyn Fn(&Engine, &mut EvalContext, &mut Scope, &[Expression]) -> Result<Dynamic, Box<EvalAltResult>>
+ Send
+ Sync;
/// An expression sub-tree in an AST.
#[derive(Debug, Clone, Hash)]
pub struct Expression<'a>(&'a Expr);
@@ -71,6 +72,7 @@ impl fmt::Debug for CustomSyntax {
}
}
/// Context of a script evaluation process.
#[derive(Debug)]
pub struct EvalContext<'a, 'b: 'a, 's, 'm, 't, 'd: 't> {
pub(crate) mods: &'a mut Imports<'b>,