Packages
rustler
0.0.6
0.38.0
0.37.3
0.37.1
0.37.0
retired
0.36.2
0.36.1
0.36.0
0.35.1
0.35.0
0.34.0
0.33.0
0.32.1
0.31.0
0.30.0
0.29.1
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.0
0.22.2
0.22.1
0.22.0
0.22.0-rc.2
0.22.0-rc.1
0.22.0-rc.0
0.21.1
0.21.0
0.20.0
0.19.1
0.19.0
0.18.0
0.17.1
0.17.0
0.16.0
0.10.1
0.10.0
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.1
0.1.0
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Mix compiler and runtime helpers for Rustler.
Current section
Files
Jump to
Current section
Files
lib/compiler/messages.ex
defmodule Rustler.Compiler.Messages do
def message(:multirust_not_installed) do
"""
Multirust could not be found on your machine.
It is required for building NIF crates automatically.
Follow the instructions in https://github.com/brson/multirust to install it.
"""
end
def message({:nonexistent_crate_directory, crate}) do
"""
Directory '#{crate}' could not be found.
One of the crate directories specified for compilation does not exist.
"""
end
def message({:cargo_toml_not_found, crate}) do
"""
No 'Cargo.toml' could be found in the '#{crate}' directory.
Are you sure it is a Rust crate?
"""
end
def message(:no_crates_property) do
"""
No NIF crates listed in project definition.
Add some crate directories under :rustler_crates in the mix.exs project definition to compile them.
Example:
rustler_crates: ["my_nif_crate/"]
"""
end
def message({:differing_versions, crate, rustler_version, codegen_version}) do
"""
The '#{crate}' crate should have the same rustler and rustler_codegen version in its Cargo.toml:
rustler version: #{rustler_version}
rustler_codegen version: #{codegen_version}
"""
end
def message({:unsupported_rustler_version, crate, supported, version}) do
"""
The crate '#{crate}' is using an unsupported version of rustler and rustler_codegen.
Should be: '#{supported}''
Is: '#{version}'
Note: The version numbers need to match exactly, including space and equals.
"""
end
def message({:rust_version_not_installed, needed_version}) do
"""
Required Rust toolchain version #{needed_version} is not installed.
It can be installed by running 'multirust update #{needed_version}'.
"""
end
def message({:no_rustler_deps, crate, version}) do
"""
No Rustler dependencies found in Cargo.toml for crate #{crate}.
Please make sure the following is in the dependencies section of your Cargo.toml file:
> rustler = #{version}
> rustler_codegen = #{version}
Note: You should already have this if you made your project with the project generator.
"""
end
def message({:cargo_no_library, crate}) do
"""
No library with name listed in Cargo.toml of crate '#{crate}'.
"""
end
end