(
pg_connection: Option<PgPool>,
sqlite_connection: Option<SqlitePool>,
redis_connection: Option<redis::aio::MultiplexedConnection>,
)
| 45 | |
| 46 | impl Vm { |
| 47 | pub fn new( |
| 48 | pg_connection: Option<PgPool>, |
| 49 | sqlite_connection: Option<SqlitePool>, |
| 50 | redis_connection: Option<redis::aio::MultiplexedConnection>, |
| 51 | ) -> Self { |
| 52 | let mut vm = Vm { |
| 53 | arena: Arena::<Rootable![State<'_>]>::new(|mc| { |
| 54 | let mut state = State::new(mc); |
| 55 | state.pg_connection = pg_connection; |
| 56 | state.sqlite_connection = sqlite_connection; |
| 57 | state.redis_connection = redis_connection; |
| 58 | state |
| 59 | }), |
| 60 | }; |
| 61 | vm.init_stdlib(); |
| 62 | vm |
| 63 | } |
| 64 | |
| 65 | pub fn run_file(&mut self, path: PathBuf) { |
| 66 | match fs::read_to_string(&path) { |
nothing calls this directly
no test coverage detected