pub struct Config {
pub workspace_root: PathBuf,
pub crate_dir: PathBuf,
pub package: String,
pub target: Target,
pub watch_paths: Vec<PathBuf>,
pub bind_addr: SocketAddr,
pub dev_token: Option<String>,
pub hot_patch_mode: HotPatchMode,
pub android: Option<AndroidParams>,
pub ios: Option<IosParams>,
}Expand description
Where the dev loop should run, what to build, and how to behave.
Constructed by whisker-cli from CLI flags + the user’s
whisker.rs (via the cli’s manifest/probe pipeline); or by an
editor plugin / test harness directly.
Flat params, not Config. Anything platform-specific lives
inside AndroidParams / IosParams as simple strings and
paths — the dev-server intentionally doesn’t depend on
whisker-config. Translating the user’s configure(&mut Config) into these fields is the cli’s job.
Fields§
§workspace_root: PathBufWorkspace root (Cargo.toml with [workspace]). Used by
whisker-build invocations + RUSTC capture directories.
crate_dir: PathBufUser-crate directory (Cargo.toml with [package]). This
is what whisker run --manifest-path resolves to; for
in-workspace examples it’s examples/<pkg>/, for an
external user it’s wherever they keep their app.
package: StringUser-crate package name (e.g. “podcast”).
target: TargetWhere the rebuilt artifact gets installed + launched.
watch_paths: Vec<PathBuf>Directories to watch for source changes. Empty defaults to
<crate_dir>/src.
bind_addr: SocketAddrAddress the WebSocket server binds.
dev_token: Option<String>Shared dev-session token. When Some, the WebSocket server only
arms the patch channel for a client whose hello carries the
matching token, and the cli delivers it to the device (iOS env /
Android system property). None runs unauthenticated (the prior
behaviour). whisker run generates a random one per session.
hot_patch_mode: HotPatchModeStrategy for reflecting code edits onto the running app.
android: Option<AndroidParams>Android install / launch params. Required iff
target == Target::Android; absent for other targets.
ios: Option<IosParams>iOS install / launch params. Required iff
target == Target::IosSimulator; absent for other targets.