MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / new

Method new

aiscript-vm/src/vm/mod.rs:47–63  ·  view source on GitHub ↗
(
        pg_connection: Option<PgPool>,
        sqlite_connection: Option<SqlitePool>,
        redis_connection: Option<redis::aio::MultiplexedConnection>,
    )

Source from the content-addressed store, hash-verified

45
46impl 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) {

Callers

nothing calls this directly

Calls 1

init_stdlibMethod · 0.80

Tested by

no test coverage detected