pub struct ScriptProgram {
pub source: String,
pub bytecode: Option<Vec<u8>>,
pub uri: String,
pub source_map: SourceMap,
pub lib_dir: Option<PathBuf>,
pub import_roots: Vec<(String, PathBuf)>,
pub cfg_flags: Vec<String>,
}Expand description
One program, handed to a host to run.
Fields§
§source: StringThe program’s source text: every file of the language, concatenated in source order. Empty when the program travels as bytecode alone.
bytecode: Option<Vec<u8>>The program compiled ahead of time, for a language that has a bytecode form. A host that runs bytecode reads this and ignores the source.
uri: StringWhere the program came from, named in a load error.
source_map: SourceMapWhere each piece of Self::source was read from, so a load error
names the script file and line rather than Self::uri.
lib_dir: Option<PathBuf>The app’s lib/ directory, where a native library a script imports is
looked for.
import_roots: Vec<(String, PathBuf)>Script libraries the app depends on: the name a script imports under, and the directory holding its sources.
cfg_flags: Vec<String>The names a script’s compile-time conditions are true for.
Trait Implementations§
Source§impl Clone for ScriptProgram
impl Clone for ScriptProgram
Source§fn clone(&self) -> ScriptProgram
fn clone(&self) -> ScriptProgram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScriptProgram
impl Debug for ScriptProgram
Source§impl Default for ScriptProgram
impl Default for ScriptProgram
Source§fn default() -> ScriptProgram
fn default() -> ScriptProgram
Auto Trait Implementations§
impl Freeze for ScriptProgram
impl RefUnwindSafe for ScriptProgram
impl Send for ScriptProgram
impl Sync for ScriptProgram
impl Unpin for ScriptProgram
impl UnsafeUnpin for ScriptProgram
impl UnwindSafe for ScriptProgram
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.