Crate julia [−] [src]
Safe and idiomatic Julia bindings for
Rust.
#JuliaLang
#RustLang
Uses nightly Rust for compilation, rustfmt with default settings for formatting, clippy for checking and resolving lints.
julia-sys are the raw ffi bindings for Julia generated with bindgen.
Example
An example of using Rust to interface with Julia.
fn main() { use julia::api::{Julia, Value}; let mut jl = Julia::new().unwrap(); jl.eval_string("println(\"Hello, Julia!\")").unwrap(); // Hello, Julia! let sqrt = jl.base().function("sqrt").unwrap(); let boxed_x = Value::from(1337.0); let boxed_sqrt_x = sqrt.call1(&boxed_x).unwrap(); let sqrt_x = f64::try_from(boxed_sqrt_x).unwrap(); println!("{}", sqrt_x); // 36.565010597564445 }
Modules
api |
Main entry point to the Julia api. |
error |
This module provides types necessary for error checking and debugging. |
string | |
sys |
This module reexports julia_sys::* for conveniency |
version |
This module provides primitives and constants for checking and comparing the version. |
Macros
cstr |
Create a CStr safely without the need to convert or allocate additional space. |
jl_catch |
This macro checks for exceptions that might have occurred in the sys::* functions. Should be used after calling any jl_* function that might throw an exception. |
jlvalues |
Creates a number of JlValue wrapper types. |
jlvec |
Creates a new Svec. |