pub struct ProgramImage {Show 16 fields
pub instructions: Vec<Instr>,
pub registers: Vec<DataWords>,
pub objs: Vec<Vec<DataWords>>,
pub maps: Vec<Vec<(DataWords, DataWords)>>,
pub strings: Vec<String>,
pub instr_src: Vec<InstrSrcImage>,
pub callsite_registers: Vec<Vec<u16>>,
pub structs: Vec<StructImage>,
pub enums: Vec<EnumImage>,
pub sources: Vec<SourceImage>,
pub allocated_arg_count: u64,
pub allocated_call_depth: u64,
pub dyn_lib_fns: Vec<DynLibFnImage>,
pub host_fns: Vec<HostFnImage>,
pub exports: Vec<ExportImage>,
pub native: Vec<NativeImage>,
}Expand description
Serializable mirror of a compiled program’s runtime state.
A dedicated DTO keeps serde off the hot runtime types: Data becomes its
pair of raw words, SmolStr becomes String, maps become key/value pairs.
Only Instr, Span, and DataType carry serde derives directly.
Fields are pub so the compiler front-end can build an image from a fresh
compile.
Fields§
§instructions: Vec<Instr>§registers: Vec<DataWords>§objs: Vec<Vec<DataWords>>§maps: Vec<Vec<(DataWords, DataWords)>>§strings: Vec<String>§instr_src: Vec<InstrSrcImage>§callsite_registers: Vec<Vec<u16>>The registers each recursive call site saves across its call, indexed by
the call-site id its SaveFrame carries.
structs: Vec<StructImage>§enums: Vec<EnumImage>§sources: Vec<SourceImage>§allocated_arg_count: u64§allocated_call_depth: u64§dyn_lib_fns: Vec<DynLibFnImage>Recipe for each dynamic-library binding, in DynamicLibFn id order. The
artifact stores only the logical library name, symbol, and marshalling
signature, never the shared object’s bytes, so the VM re-opens the
library and re-binds the symbol by name at load time (see
resolve_library_filename).
host_fns: Vec<HostFnImage>Recipe for each host function declared by the program, in host-fn id
order. The HostRegistry handed to load_program supplies the
closure behind each one; an unregistered name is a load error.
exports: Vec<ExportImage>One entry per host-callable function, each with the call trampoline the compiler emitted for it at build time. This is what lets the VM invoke a script function by name with no compiler present.
native: Vec<NativeImage>Machine code for some of the program’s functions, one section per machine it was built for. The VM runs the first section this machine can run and the bytecode for everything else; a program whose sections all name another machine runs on bytecode alone. The bytecode stays complete either way.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ProgramImage
impl<'de> Deserialize<'de> for ProgramImage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProgramImage
impl RefUnwindSafe for ProgramImage
impl Send for ProgramImage
impl Sync for ProgramImage
impl Unpin for ProgramImage
impl UnsafeUnpin for ProgramImage
impl UnwindSafe for ProgramImage
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);