plushie/binary
Resolve the path to the plushie Rust binary.
Resolution order:
- PLUSHIE_BINARY_PATH env var (error if set but file missing)
- build/plushie/bin/plushie-renderer-{platform}-{arch} (downloaded binary)
- build/plushie/bin/plushie-renderer (platform-generic fallback)
- priv/bin/plushie-renderer-{platform}-{arch} (legacy location, backward compat)
- priv/bin/plushie-renderer (legacy location, backward compat)
- Custom build at _build/{env}/plushie-renderer/target/release/plushie-renderer
- Common local paths (./plushie-renderer, ../plushie-renderer/target/release/plushie-renderer)
Returns Result(String, BinaryError) with the path on success.
Types
Error when the plushie binary cannot be found.
pub type BinaryError {
NotFound(searched: List(String))
EnvVarPointsToMissing(path: String)
}
Constructors
-
NotFound(searched: List(String))Binary not found at any searched path.
-
EnvVarPointsToMissing(path: String)PLUSHIE_BINARY_PATH is set but the file doesn’t exist.
Values
pub fn build_name(project_name: Result(String, a)) -> String
Returns the binary name for a custom build with native widgets.
When native widgets are configured, the binary is named “{project}-renderer” (derived from gleam.toml project name). Otherwise returns “plushie-renderer”.
pub fn download_dir() -> String
Returns the directory where downloaded binaries are stored. Shared across environments (the binary is platform-specific, not env-specific).
pub fn error_to_string(err: BinaryError) -> String
Format a binary error as a human-readable string.
pub fn find() -> Result(String, BinaryError)
Find the plushie binary, searching in priority order.
pub fn not_found_message() -> String
Standard instructions for resolving a missing plushie-renderer binary.
Used by the test infrastructure and error messages to provide consistent guidance.