pub struct GenerateContext {
pub app_meta: AppMeta,
pub ios: Option<IosProjectIr>,
pub android: Option<AndroidProjectIr>,
pub journal: MutationJournal,
pub app_crate_dir: Option<PathBuf>,
}Expand description
The mutable handle plugins receive in Plugin::apply. Wraps
every IR the engine is currently materializing plus the running
MutationJournal.
Each target IR is Option because not every whisker generate
invocation touches both platforms — the CLI passes only the IRs
for targets currently enabled by the user’s --target flag.
Plugins should if let Some(ios) = &mut ctx.ios { ... } rather
than assuming both exist.
Fields§
§app_meta: AppMetaRead-only basic facts about the app, derived from
Config. Plugins use these as defaults — e.g. an
Info.plist plugin sets CFBundleIdentifier from
app_meta.ios_bundle_id.
ios: Option<IosProjectIr>iOS IR. Some when the current whisker generate run is
rendering gen/ios/.
android: Option<AndroidProjectIr>Android IR. Some when the current run is rendering
gen/android/.
journal: MutationJournalAppend-only attribution log. The engine inspects this after the pipeline finishes to surface conflicts and verbose summaries; plugins don’t read it directly.
app_crate_dir: Option<PathBuf>Absolute path to the consuming app crate’s root (the directory
holding its Cargo.toml / whisker.rs). Set by the engine
before the pipeline runs so plugins can resolve paths the user
spelled relative to their app — e.g. whisker-asset’s
c.dir("assets") resolves against this.
None in unit tests / pipelines that don’t run from a real
app crate. A plugin that needs it should error clearly when it
is absent rather than guessing the current working directory —
subprocess plugins don’t inherit a reliable cwd.
Trait Implementations§
Source§impl Clone for GenerateContext
impl Clone for GenerateContext
Source§fn clone(&self) -> GenerateContext
fn clone(&self) -> GenerateContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more