pub struct LuaTexHost { /* private fields */ }Expand description
The Lua interpreter with LuaTeX’s libraries.
Implementations§
Source§impl LuaTexHost
impl LuaTexHost
Sourcepub fn check_io_names(&self) -> Result<()>
pub fn check_io_names(&self) -> Result<()>
Makes io.open and io.lines honour openin_any and
openout_any, as LuaTeX does when it typesets (not in texlua
scripts, observed).
Sourcepub fn make_safer(&self) -> Result<()>
pub fn make_safer(&self) -> Result<()>
-safer, as observed with LuaTeX: the functions that run programs
or change or open files return nil without doing anything, and
debug.traceback is removed.
Trait Implementations§
Source§impl Drop for LuaTexHost
impl Drop for LuaTexHost
Source§impl LuaHost for LuaTexHost
impl LuaHost for LuaTexHost
Source§fn run(
&self,
engine: &mut Engine,
name: &str,
code: &[u8],
) -> Result<(), String>
fn run( &self, engine: &mut Engine, name: &str, code: &[u8], ) -> Result<(), String>
Runs a chunk of Lua code for
\directlua (or \latelua, etc.).
name is the chunk name. Text printed with tex.print must be
pushed back into the engine’s input by the host.Source§fn call_simple(&self, engine: &mut Engine, name: &str) -> Result<(), String>
fn call_simple(&self, engine: &mut Engine, name: &str) -> Result<(), String>
Calls callback
name without arguments, ignoring its results
(pre_dump, stop_run, …). Does nothing if none is registered.Source§fn has_callback(&self, name: &str) -> bool
fn has_callback(&self, name: &str) -> bool
Whether a Lua function is registered for callback
name.Source§fn define_font(
&self,
engine: &mut Engine,
name: &[u8],
size: i32,
) -> Option<u32>
fn define_font( &self, engine: &mut Engine, name: &[u8], size: i32, ) -> Option<u32>
Calls the
define_font callback. Returns the id of the font it
defined, or None if the font could not be loaded.Source§fn list_filter(
&self,
engine: &mut Engine,
callback_name: &str,
head: NodeRef,
group: &str,
) -> ListFilter
fn list_filter( &self, engine: &mut Engine, callback_name: &str, head: NodeRef, group: &str, ) -> ListFilter
Calls a node-list filter callback (
pre_linebreak_filter,
hpack_filter, post_linebreak_filter, …) on the list starting at
head. Returns the new head; ListFilter::Flush means the list
must be discarded.Source§fn mlist_to_hlist(
&self,
engine: &mut Engine,
head: NodeRef,
style: i32,
penalties: bool,
) -> Option<NodeRef>
fn mlist_to_hlist( &self, engine: &mut Engine, head: NodeRef, style: i32, penalties: bool, ) -> Option<NodeRef>
Calls the
mlist_to_hlist callback on math list head in style
style (0–7); None if the callback failed or none is set.Source§fn pipe_read(&self, engine: &mut Engine, cmd: &[u8]) -> Option<Vec<u8>>
fn pipe_read(&self, engine: &mut Engine, cmd: &[u8]) -> Option<Vec<u8>>
Runs shell command
cmd under the shell escape rules (as Lua’s
io.popen does) and returns its output; None if it may not run.Source§fn input_level_string(&self, engine: &mut Engine, n: i64) -> Option<Vec<u8>>
fn input_level_string(&self, engine: &mut Engine, n: i64) -> Option<Vec<u8>>
Calls the
input_level_string callback with input-stack depth n;
None if it returned no string.Source§fn glyph_info(&self, engine: &mut Engine, p: NodeRef) -> Option<Vec<u8>>
fn glyph_info(&self, engine: &mut Engine, p: NodeRef) -> Option<Vec<u8>>
Calls the
glyph_info callback for glyph node p: Some(text) is
what to print, None means the callback returned no string.Auto Trait Implementations§
impl !RefUnwindSafe for LuaTexHost
impl !Send for LuaTexHost
impl !Sync for LuaTexHost
impl !UnwindSafe for LuaTexHost
impl Freeze for LuaTexHost
impl Unpin for LuaTexHost
impl UnsafeUnpin for LuaTexHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more