pub struct ProgramAsset {
pub program: Program,
pub initial_context: World,
pub effect_rows: Vec<EffectRowEntry>,
}Expand description
The immutable bytecode portion of a compiled story — what the VM
actually executes — together with the fresh starting World
(globals seeded from VAR/CONST/LIST defaults; zero visit and
turn counts, all-World policy).
initial_context is read-only “fresh start” state, exposed for
consumers that want to compare against or reset toward program
defaults. It is not what seeds BrinkGlobals
— since F6.2, fulfill_flow_requests creates the shared BrinkGlobals
World via brink_runtime::World::new, resolving the host’s
WorldPolicy (installed via
BrinkPlugin::with_policy) against
this program’s symbol table — initial_context (always the all-World
policy) plays no part in that. There is no “commit back to reset”
verb either; see BrinkGlobals’s docs.
No execution happens to produce this — it’s a pure function of the
linked Program’s declarations. Stories with free-floating
top-of-file setup (~ initialize_save_data() etc.) need a flow at
root to advance through that code; the runtime doesn’t pre-run it.
Produced as a labeled subasset by InkbLoader (and the .ink
source loader) under the label program. Reference it through
BrinkStoryAsset::program or load it directly via the labeled
path path.inkb#program.
Fields§
§program: Program§initial_context: World§effect_rows: Vec<EffectRowEntry>The story’s decoded EffectRows DefinitionId → row table (T2-3,
docs/effects-spec.md §11; PR #878) — carried here rather than on
Program itself because BH-1’s capability join
(crate::capability::compute_container_access) needs a live
CapabilityRegistry resource (app World access) to resolve
capability names to ComponentIds, which an AssetLoader never
has; the join runs later, in a system reacting to this asset’s load
event, so the rows must survive to that point. Empty for stories
compiled before T2-3 shipped rows, or that declare no knots/stitches.
Trait Implementations§
impl Asset for ProgramAsset
Source§impl TypePath for ProgramAsset
impl TypePath for ProgramAsset
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl VisitAssetDependencies for ProgramAsset
impl VisitAssetDependencies for ProgramAsset
fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId))
Auto Trait Implementations§
impl Freeze for ProgramAsset
impl RefUnwindSafe for ProgramAsset
impl Send for ProgramAsset
impl Sync for ProgramAsset
impl Unpin for ProgramAsset
impl UnsafeUnpin for ProgramAsset
impl UnwindSafe for ProgramAsset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.