mers_lib to 0.5.0, readme updated

This commit is contained in:
Mark
2024-02-17 14:06:19 +01:00
parent 0c87c69743
commit cc4a4366c9
5 changed files with 100 additions and 80 deletions

View File

@@ -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,