wip: fix(dsl): maybe getting somewhere?
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-06-21 13:48:45 +03:00
parent 91dc77cfea
commit 11f686650f
19 changed files with 964 additions and 918 deletions

View file

@ -46,9 +46,9 @@ pub trait MaybeHas<T>: Send + Sync {
/// May compute a `RetVal` from `Args`.
pub trait Eval<Args, RetVal> {
/// A custom operation on [Args] that may return [Result::Err] or [Option::None].
fn try_eval (&self, args: Args) -> Perhaps<RetVal>;
fn try_eval (&self, args: &Args) -> Perhaps<RetVal>;
/// Invoke a custom operation, converting a `None` result to a custom `Box<dyn Error>`.
fn eval <E: Into<Box<dyn std::error::Error>>> (&self, args: Args, error: impl Fn()->E)
fn eval <E: Into<Box<dyn std::error::Error>>> (&self, args: &Args, error: impl Fn()->E)
-> Usually<RetVal>
{
match self.try_eval(args)? {