pub struct Julia { /* private fields */ }
Expand description

A Julia instance.

You must create this instance with RuntimeBuilder::start before you can start using Julia from Rust. While this struct exists Julia is active, dropping it causes the shutdown code to be called but this doesn’t leave Julia in a state from which it can be reinitialized.

Implementations

Enable or disable colored error messages originating from Julia. If this is enabled the error message in JlrsError::Exception can contain ANSI color codes. This feature is disabled by default.

Calls include in the Main module in Julia, which executes the file’s contents in that module. This has the same effect as calling include in the Julia REPL.

This is unsafe because the contents of the file are evaluated.

Example:

unsafe { julia.include("Path/To/MyJuliaCode.jl").unwrap(); }

This method is a main entrypoint to interact with Julia. It takes a closure with two arguments, a Global and a GcFrame, and can return arbitrary results.

Example:

  julia.scope(|_global, mut frame| {
      let _i = Value::new(&mut frame, 1u64)?;
      Ok(())
  }).unwrap();

This method is a main entrypoint to interact with Julia. It takes a closure with two arguments, a Global and a GcFrame, and can return arbitrary results. The frame will have capacity for at least capacity roots.

Example:

  julia.scope_with_capacity(1, |_global, mut frame| {
      let _i = Value::new(&mut frame, 1u64)?;
      Ok(())
  }).unwrap();

Trait Implementations

Executes the destructor for this type. Read more

Enable or disable the GC.

Enable or disable GC logging. Read more

Returns true if the GC is enabled.

Force a collection.

Insert a safepoint, a point where the garbage collector may run.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.