Crate zng_env

source ·
Expand description

Process environment directories and unique name.

§Crate

This crate is part of the zng project.

§Cargo Features

This crate provides 1 feature flag, not enabled by default.

§"built_res"

Check if res path is available in init_built_res first.

Enabled by default in debug builds, ignored in Android and Wasm.

Macros§

  • Inits process metadata, calls process start handlers and defines the process lifetime in main.
  • Register a FnOnce(&ProcessStartArgs) closure to be called on init!.

Structs§

Enums§

Functions§

  • Gets metadata about the application.
  • Helper function for adapting Android assets to the cross-platform res API.
  • Panics with an standard message if zng::env::init!() was not called or was not called correctly.
  • Gets a path relative to the package binaries.
  • Gets a path relative to the cache directory for the app.
  • Removes all cache files possible.
  • Gets a path relative to the user config directory for the app.
  • Terminates the current process with the specified exit code.
  • Sets a custom path for the “built resources” override checked by res in debug builds.
  • Sets a custom cache path.
  • Sets a custom original_config path.
  • Sets a custom res path.
  • Save new_path as the new cache path and make a best effort to move existing cache files.
  • Copied all config to new_path and saves it as the config path.
  • Register a handler to run once when the current process exits.
  • Config path before migration.
  • Get the state of the current process instance.
  • Gets a path relative to the package resources.