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§
- init
- Inits process metadata, calls process start handlers and defines the process lifetime in
main. - on_
process_ start - Register a
FnOnce(&ProcessStartArgs)closure to be called oninit!.
Structs§
- About
- Metadata about the app and main crate.
- Process
Exit Args - Arguments for
on_process_exithandlers. - Process
Start Args - Arguments for
on_process_starthandlers.
Enums§
- Process
Lifetime State - Defines the state of the current process instance.
Functions§
- about
- Gets metadata about the application.
- android_
install_ res - Helper function for adapting Android assets to the cross-platform
resAPI. - assert_
inited - Panics with an standard message if
zng::env::init!()was not called or was not called correctly. - bin
- Gets a path relative to the package binaries.
- cache
- Gets a path relative to the cache directory for the app.
- clear_
cache - Removes all cache files possible.
- config
- Gets a path relative to the user config directory for the app.
- exit
- Terminates the current process with the specified exit code.
- init_
built_ res - Sets a custom path for the “built resources” override checked by
resin debug builds. - init_
cache - Sets a custom
cachepath. - init_
config - Sets a custom
original_configpath. - init_
process_ name - Set the process runtime name if it has not been named yet.
- init_
res - Sets a custom
respath. - migrate_
cache - Save
new_pathas the new cache path and make a best effort to move existing cache files. - migrate_
config - Copies all config to
new_pathand saves it as the config path. - on_
process_ exit - Register a
handlerto run once when the current process exits. - original_
config - Config path before migration.
- process_
lifetime_ state - Get the state of the current process instance.
- process_
name - Gets a process runtime name.
- res
- Gets a path relative to the package resources.
- set_
process_ name - Changes the process runtime name.