runestick 0.6.8

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

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

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

    module.async_inst_fn("next", Stream::next)?;
    module.async_inst_fn("resume", Stream::resume)?;
    Ok(module)
}