mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-15 19:47:50 +01:00
mers_lib to 0.5.0, readme updated
This commit is contained in:
@@ -23,6 +23,18 @@ pub struct Function {
|
||||
)>,
|
||||
}
|
||||
impl Function {
|
||||
pub fn new(
|
||||
out: impl Fn(&Type) -> Result<Type, CheckError> + Send + Sync + 'static,
|
||||
run: impl Fn(Data) -> Data + Send + Sync + 'static,
|
||||
) -> Self {
|
||||
Self {
|
||||
info: Arc::new(crate::info::Info::neverused()),
|
||||
info_check: Arc::new(Mutex::new(crate::info::Info::neverused())),
|
||||
out: Arc::new(move |a, _| out(a)),
|
||||
run: Arc::new(move |a, _| run(a)),
|
||||
inner_statements: None,
|
||||
}
|
||||
}
|
||||
pub fn with_info_run(&self, info: Arc<Info>) -> Self {
|
||||
Self {
|
||||
info,
|
||||
|
||||
Reference in New Issue
Block a user