niffler_precompiled
Public runtime API used by generated Erlang loaders and by consumers.
This module is also the CLI entry point (niffler / gleam run -m niffler_precompiled).
Types
pub type Info {
Info(
package: String,
version: String,
target: String,
runtime_nif_version: String,
manifest_path: String,
cache_root: String,
artifact: option.Option(manifest.Artifact),
source_available: Bool,
)
}
Constructors
-
Info( package: String, version: String, target: String, runtime_nif_version: String, manifest_path: String, cache_root: String, artifact: option.Option(manifest.Artifact), source_available: Bool, )
Values
pub fn artifact_path(
package: String,
) -> Result(String, errors.NifflerError)
Resolve, verify, and cache the NIF for package, returning an absolute path
without the platform extension for erlang:load_nif/2.
pub fn clear_cache(
package: String,
) -> Result(Nil, errors.NifflerError)
pub fn format_error(error: errors.NifflerError) -> String
pub fn info(package: String) -> Result(Info, errors.NifflerError)
pub fn main() -> Nil
CLI entry point. Kept on the root module so the package can be invoked with
gleam run -m niffler_precompiled.
pub fn main_with_args(arguments: List(String)) -> Nil
Escript entry point: arguments come from the escript runtime.
pub fn prefetch(
package: String,
) -> Result(Nil, errors.NifflerError)
Download and verify the artifact into the cache without loading it.
pub fn raise_load_error(
package: String,
error: errors.NifflerError,
) -> Nil
Called by the generated loader when loading fails. Prints an actionable
diagnostic and raises so the module load fails rather than leaving silent
nif_not_loaded stubs behind.