File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,16 @@ impl crate::api::plugin_api::repl::api::http_client::Host for PluginHost {
8282 }
8383}
8484
85+ ///
86+ impl crate :: api:: plugin_api:: repl:: api:: host_state_plugin:: Host for PluginHost {
87+ async fn get_repl_var ( & mut self , key : String ) -> Option < String > {
88+ None
89+ // Can't do the following because `PluginHost` does not have access to repl_vars
90+ // we need to add a repl_vars field to PluginHost that points to the repl_vars field of WasiState
91+ // self.repl_vars.get(&key).cloned()
92+ }
93+ }
94+
8595/// It is necessary to implement this trait on PluginHost because other parts rely on it.
8696impl crate :: api:: plugin_api:: repl:: api:: transport:: Host for PluginHost {
8797 // This trait has no methods, so no implementation needed
Original file line number Diff line number Diff line change @@ -23,7 +23,12 @@ interface http-client {
2323 get : func (url : string , headers : list <http-header >) -> result <http-response , string >;
2424}
2525
26+ interface host-state-plugin {
27+ get-repl-var : func (key : string ) -> option <string >;
28+ }
29+
2630world plugin-api {
2731 import http-client ;
32+ import host-state-plugin ;
2833 export plugin ;
2934}
You can’t perform that action at this time.
0 commit comments