Fix sync feature.

This commit is contained in:
Stephen Chung
2020-05-12 16:32:22 +08:00
parent 2e28967565
commit 03c64688ad
7 changed files with 88 additions and 63 deletions

View File

@@ -31,6 +31,7 @@ use crate::stdlib::{
};
/// A trait that encapsulates a module resolution service.
#[cfg(not(feature = "sync"))]
pub trait ModuleResolver {
/// Resolve a module based on a path string.
fn resolve(
@@ -42,6 +43,19 @@ pub trait ModuleResolver {
) -> Result<Module, Box<EvalAltResult>>;
}
/// A trait that encapsulates a module resolution service.
#[cfg(feature = "sync")]
pub trait ModuleResolver: Send + Sync {
/// Resolve a module based on a path string.
fn resolve(
&self,
engine: &Engine,
scope: Scope,
path: &str,
pos: Position,
) -> Result<Module, Box<EvalAltResult>>;
}
/// Default function access mode.
const DEF_ACCESS: FnAccess = FnAccess::Public;