Struct tectonic_bridge_core::CoreBridgeLauncher
source · pub struct CoreBridgeLauncher<'a> { /* private fields */ }
Expand description
A mechanism for launching bridged FFI code.
Implementations§
source§impl<'a> CoreBridgeLauncher<'a>
impl<'a> CoreBridgeLauncher<'a>
sourcepub fn new(
hooks: &'a mut dyn DriverHooks,
status: &'a mut dyn StatusBackend
) -> Self
pub fn new( hooks: &'a mut dyn DriverHooks, status: &'a mut dyn StatusBackend ) -> Self
Set up a new context for launching bridged FFI code.
This function uses the default security stance, which disallows all
known-insecure engine features. Use Self::new_with_security
to
provide your own security settings that can attempt to allow the use of
such features.
sourcepub fn new_with_security(
hooks: &'a mut dyn DriverHooks,
status: &'a mut dyn StatusBackend,
security: SecuritySettings
) -> Self
pub fn new_with_security( hooks: &'a mut dyn DriverHooks, status: &'a mut dyn StatusBackend, security: SecuritySettings ) -> Self
Set up a new context for launching bridged FFI code.
sourcepub fn with_expose_absolute_paths(
&mut self,
expose_absolute_paths: bool
) -> &mut Self
pub fn with_expose_absolute_paths( &mut self, expose_absolute_paths: bool ) -> &mut Self
While absolute paths are useful (for SyncTeX and external tools that resolve paths to TeX sources), we can disable them for reproducibility.
sourcepub fn with_mtime_override(&mut self, mtime_override: Option<i64>) -> &mut Self
pub fn with_mtime_override(&mut self, mtime_override: Option<i64>) -> &mut Self
Ditto for file modification timestamps. In deterministic mode, we return
the configured build time (i.e. SOURCE_DATE_EPOCH
) instead of the
modification timestamp reported by the IO subsystem.
sourcepub fn with_global_lock<F, T>(&mut self, callback: F) -> Result<T>
pub fn with_global_lock<F, T>(&mut self, callback: F) -> Result<T>
Invoke a function to launch a bridged FFI engine with a global mutex held.
This function must be used when invoking C code that makes use of the global core bridge state functions. Unfortunately, because our error reporting is based on setjmp/longjmp and it is Undefined Behavior to setjmp/longjmp across FFI boundaries, we cannot provide a more foolproof API.
The invoked code must call the functions ttbc_global_engine_enter
and ttbc_global_engine_exit
according to the pattern described in
tectonic_bridge_core.h
. If an abort is detected, the callback function
should return Err(EngineAbortedError::new_abort_indicator())
.