runestick 0.9.1

Runescript, a generic stack-based virtual machine for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! The `std::mem` module.

use crate::{ContextError, Module, Value, VmError};

/// Construct the `std` module.
pub fn module() -> Result<Module, ContextError> {
    let mut module = Module::with_crate_item("std", &["mem"]);
    module.function(&["drop"], drop_impl)?;
    Ok(module)
}

fn drop_impl(value: Value) -> Result<(), VmError> {
    value.take()?;
    Ok(())
}