Struct wolfram_app_discovery::WolframApp
source · 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
impl WolframApp
sourcepub fn try_default() -> Result<Self, Error>
pub fn try_default() -> Result<Self, Error>
Find the default Wolfram Language installation on this computer.
Discovery procedure
-
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.
-
-
If
wolframscript
is available onPATH
, use it to evaluate$InstallationDirectory
, and return the app at that location. -
Use operating system APIs to discover installed Wolfram applications.
- This will discover apps installed in standard locations, like
/Applications
on macOS orC:\Program Files
on Windows.
- This will discover apps installed in standard locations, like
sourcepub fn from_app_directory(app_dir: PathBuf) -> Result<WolframApp, Error>
pub fn from_app_directory(app_dir: PathBuf) -> Result<WolframApp, Error>
Construct a WolframApp
from an application directory path.
Example paths:
Operating system | Example path |
---|---|
macOS | /Applications/Mathematica.app |
sourcepub fn from_installation_directory(
location: PathBuf
) -> Result<WolframApp, Error>
pub fn from_installation_directory( location: PathBuf ) -> Result<WolframApp, Error>
Construct a WolframApp
from the
$InstallationDirectory
of a Wolfram System installation.
Example paths:
Operating system | Example path |
---|---|
macOS | /Applications/Mathematica.app/Contents/ |
sourcepub fn app_type(&self) -> WolframAppType
pub fn app_type(&self) -> WolframAppType
Get the product type of this application.
sourcepub fn app_version(&self) -> &AppVersion
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.
sourcepub fn app_directory(&self) -> PathBuf
pub fn app_directory(&self) -> PathBuf
Application directory location.
sourcepub fn app_executable(&self) -> Option<PathBuf>
pub fn app_executable(&self) -> Option<PathBuf>
Location of the application’s main executable.
- macOS:
CFBundleCopyExecutableURL()
location. - Windows:
RegGetValue(_, _, "ExecutablePath", ...)
location. - Linux: TODO
sourcepub fn wolfram_version(&self) -> Result<WolframVersion, Error>
pub fn wolfram_version(&self) -> Result<WolframVersion, Error>
Returns the version of the Wolfram Language bundled with this application.
sourcepub fn installation_directory(&self) -> PathBuf
pub fn installation_directory(&self) -> PathBuf
The $InstallationDirectory
of this Wolfram System
installation.
sourcepub fn kernel_executable_path(&self) -> Result<PathBuf, Error>
pub fn kernel_executable_path(&self) -> Result<PathBuf, Error>
Returns the location of the
WolframKernel
executable.
sourcepub fn wolframscript_executable_path(&self) -> Result<PathBuf, Error>
pub fn wolframscript_executable_path(&self) -> Result<PathBuf, Error>
Returns the location of the
wolframscript
executable.
sourcepub fn wstp_sdks(&self) -> Result<Vec<Result<WstpSdk, Error>>, Error>
pub fn wstp_sdks(&self) -> Result<Vec<Result<WstpSdk, Error>>, Error>
Get a list of all WstpSdk
s provided by this app.
sourcepub fn target_wstp_sdk(&self) -> Result<WstpSdk, Error>
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.
sourcepub fn wstp_c_header_path(&self) -> Result<PathBuf, Error>
👎Deprecated: use WolframApp::target_wstp_sdk()?.wstp_c_header_path()
instead
pub fn wstp_c_header_path(&self) -> Result<PathBuf, Error>
WolframApp::target_wstp_sdk()?.wstp_c_header_path()
insteadsourcepub fn wstp_static_library_path(&self) -> Result<PathBuf, Error>
👎Deprecated: use WolframApp::target_wstp_sdk()?.wstp_static_library_path()
instead
pub fn wstp_static_library_path(&self) -> Result<PathBuf, Error>
WolframApp::target_wstp_sdk()?.wstp_static_library_path()
insteadsourcepub fn library_link_c_includes_directory(&self) -> Result<PathBuf, Error>
pub fn library_link_c_includes_directory(&self) -> Result<PathBuf, Error>
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.
sourcepub fn wstp_compiler_additions_directory(&self) -> Result<PathBuf, Error>
👎Deprecated: use WolframApp::target_wstp_sdk().sdk_dir().join("CompilerAdditions")
instead
pub fn wstp_compiler_additions_directory(&self) -> Result<PathBuf, Error>
WolframApp::target_wstp_sdk().sdk_dir().join("CompilerAdditions")
insteadReturns the location of the CompilerAdditions subdirectory of the WSTP SDK.
Trait Implementations§
source§impl Clone for WolframApp
impl Clone for WolframApp
source§fn clone(&self) -> WolframApp
fn clone(&self) -> WolframApp
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more