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
//! The `std::stream` module.

use crate::{ContextError, Module, Stream};

/// Construct the `std::stream` module.
pub fn module() -> Result<Module, ContextError> {
    let mut module = Module::with_crate_item("std", &["stream"]);
    module.ty::<Stream>()?;
    module.async_inst_fn("next", Stream::next)?;
    module.async_inst_fn("resume", Stream::resume)?;
    Ok(module)
}