Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass down context between host and guest #3

Closed
geofmureithi opened this issue Aug 9, 2023 · 0 comments · Fixed by #11
Closed

Pass down context between host and guest #3

geofmureithi opened this issue Aug 9, 2023 · 0 comments · Fixed by #11

Comments

@geofmureithi
Copy link
Owner

Imagine doing this:

let context = Context::new(); // Context shared by plugins
let runtime = Runtime::new(context);

Then on guest:

#[plugy::plugin]
trait Greeter {
    fn greet(&self, ctx:Context) -> String;
}

Context can expose methods like fetch etc which would have external access for guests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant