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

A local installation of the Wolfram System.

See the wolfram-app-discovery crate documentation for usage examples.

Implementations§

source§

impl WolframApp

source

pub fn try_default() -> Result<Self, Error>

Find the default Wolfram Language installation on this computer.

Discovery procedure
  1. If the WOLFRAM_APP_DIRECTORY environment variable is set, return that.

    • Setting this environment variable may be necessary if a Wolfram application was installed to a location not supported by the automatic discovery mechanisms.

    • This enables advanced users of programs based on wolfram-app-discovery to specify the Wolfram installation they would prefer to use.

  2. If wolframscript is available on PATH, use it to evaluate $InstallationDirectory, and return the app at that location.

  3. Use operating system APIs to discover installed Wolfram applications.

    • This will discover apps installed in standard locations, like /Applications on macOS or C:\Program Files on Windows.
source

pub fn from_app_directory(app_dir: PathBuf) -> Result<WolframApp, Error>

Construct a WolframApp from an application directory path.

Example paths:
Operating systemExample path
macOS/Applications/Mathematica.app
source

pub fn from_installation_directory( location: PathBuf ) -> Result<WolframApp, Error>

Construct a WolframApp from the $InstallationDirectory of a Wolfram System installation.

Example paths:
Operating systemExample path
macOS/Applications/Mathematica.app/Contents/
source

pub fn app_type(&self) -> WolframAppType

Get the product type of this application.

source

pub fn app_version(&self) -> &AppVersion

Get the application version.

See also WolframApp::wolfram_version(), which returns the version of the Wolfram Language bundled with app.

source

pub fn app_directory(&self) -> PathBuf

Application directory location.

source

pub fn app_executable(&self) -> Option<PathBuf>

Location of the application’s main executable.

  • macOS: CFBundleCopyExecutableURL() location.
  • Windows: RegGetValue(_, _, "ExecutablePath", ...) location.
  • Linux: TODO
source

pub fn wolfram_version(&self) -> Result<WolframVersion, Error>

Returns the version of the Wolfram Language bundled with this application.

source

pub fn installation_directory(&self) -> PathBuf

The $InstallationDirectory of this Wolfram System installation.

source

pub fn kernel_executable_path(&self) -> Result<PathBuf, Error>

Returns the location of the WolframKernel executable.

source

pub fn wolframscript_executable_path(&self) -> Result<PathBuf, Error>

Returns the location of the wolframscript executable.

source

pub fn wstp_sdks(&self) -> Result<Vec<Result<WstpSdk, Error>>, Error>

Get a list of all WstpSdks provided by this app.

source

pub fn target_wstp_sdk(&self) -> Result<WstpSdk, Error>

Get the WstpSdk for the current target platform.

This function uses SystemID::current_rust_target() to determine the appropriate entry from WolframApp::wstp_sdks() to return.

source

pub fn wstp_c_header_path(&self) -> Result<PathBuf, Error>

👎Deprecated: use WolframApp::target_wstp_sdk()?.wstp_c_header_path() instead

Returns the location of the wstp.h header file.

Note: The wstp crate provides safe Rust bindings to WSTP.

source

pub fn wstp_static_library_path(&self) -> Result<PathBuf, Error>

👎Deprecated: use WolframApp::target_wstp_sdk()?.wstp_static_library_path() instead

Returns the location of the WSTP static library.

Note: The wstp crate provides safe Rust bindings to WSTP.

Returns the location of the directory containing the Wolfram LibraryLink C header files.

The standard set of LibraryLink C header files includes:

  • WolframLibrary.h
  • WolframSparseLibrary.h
  • WolframImageLibrary.h
  • WolframNumericArrayLibrary.h

Note: The wolfram-library-link crate provides safe Rust bindings to the Wolfram LibraryLink interface.

source

pub fn wstp_compiler_additions_directory(&self) -> Result<PathBuf, Error>

👎Deprecated: use WolframApp::target_wstp_sdk().sdk_dir().join("CompilerAdditions") instead

Returns the location of the CompilerAdditions subdirectory of the WSTP SDK.

Trait Implementations§

source§

impl Clone for WolframApp

source§

fn clone(&self) -> WolframApp

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WolframApp

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.