bulwark-security / bulwark

Automated security decision making under uncertainty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explore using less macro stuff and rely more on trait features for handler declarations

sporkmonger opened this issue · comments

The current macro setup doesn't always play nicely with rust-analyzer and it would be nice to have better IDE support while writing plugin logic.

There might be a few ways to do this, but it might be possible to get a blanket implementation of the Guest trait to work?

// something like this maybe
impl<T: HttpHandlers> Guest for T {
    // ...
}

Alternatively, if we hit orphan rule issues, maybe:

struct Wrapper<T: HttpHandlers>(T);

impl<T: HttpHandlers> Guest for Wrapper<T> {
   // ...
}

We probably always need a macro somewhere, but this might cut down on how much the macro is doing and increase what we can document.