Skip to main content

run_lua

Function run_lua 

Source
pub fn run_lua<N>(source: &[u8], sink: &N) -> Result<(), Error<N::Error>>
where for<'call> N: Nsi + Nsi<Arg<'call> = Arg<'call, 'static>>,
Expand description

Run source, applying the ɴsɪ calls it makes to sink.

Takes bytes because a Lua chunk is bytes: a script naming a Latin-1 file is one 3Delight runs, and one nsi_intermediate::write_lua emits.

§Errors

Error::Lua for a script that fails to load or run, and Error::Sink when the sink refuses a call. A handle or attribute name that is not UTF-8 is an Error::Lua conversion failure: ɴsɪ identifiers reach nsi_trait::Nsi as &str, so this front end refuses them exactly as the stream reader does.