Skip to content

Commit

Permalink
Calling provider as context data
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Jan 19, 2021
1 parent a383e09 commit 7c60bb1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 110 deletions.
25 changes: 0 additions & 25 deletions rune/src/run/capability.rs

This file was deleted.

60 changes: 0 additions & 60 deletions rune/src/run/provider.rs

This file was deleted.

26 changes: 1 addition & 25 deletions rune/src/run/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,9 @@ use std::ffi::c_void;
use std::cell::RefCell;
use wasmer_runtime::{instantiate, Func, Instance, func, imports, Array, Ctx, WasmPtr};
use std::sync::{Arc, Mutex};
#[derive(Debug, Clone)]
pub struct CapabilityParam {
pub value: Vec<u8>,
pub value_type: runic_types::PARAM_TYPE
}

#[derive(Debug, Clone)]
pub struct CapabilityRequest {
pub c_type: runic_types::CAPABILITY,
pub params: std::collections::HashMap<String, CapabilityParam>
}


impl CapabilityRequest {
pub fn init(c_type: runic_types::CAPABILITY) -> CapabilityRequest {
return CapabilityRequest{
c_type,
params: std::collections::HashMap::new()
}
}
pub fn set_param(&mut self, key: String, value: Vec<u8>, value_type: runic_types::PARAM_TYPE) {
self.params.insert(key, CapabilityParam{
value,
value_type
});
}
}
use crate::run::vm::capability::*;

pub struct Model {
weights: Vec<u8>
Expand Down

0 comments on commit 7c60bb1

Please sign in to comment.