pub struct CompileOutput {Show 20 fields
pub instructions: Vec<Instr>,
pub registers: Vec<Data>,
pub pools: Pools,
pub instr_src: Vec<InstrSrc>,
pub callsite_registers: Vec<Vec<u16>>,
pub dyn_lib_fns: Vec<DynamicLibFn>,
pub host_fns: Vec<HostFnSig>,
pub allocated_arg_count: usize,
pub allocated_call_depth: usize,
pub sources: Vec<Source>,
pub structs: Vec<Struct>,
pub enums: Vec<EnumType>,
pub functions: Vec<Function>,
pub dyn_libs: Vec<Dynamiclib>,
pub namespaces: FileNamespaces,
pub const_registers: FxHashMap<Data, u16>,
pub free_registers: Vec<u16>,
pub indirect_registers: IndirectRegisters,
pub generics: Generics,
pub optimize: bool,
}Expand description
The complete result of compiling a candela program.
In addition to the fields the CLI/VM needs to run main, this carries the
compiler-side tables (functions, dyn_libs, namespace, register
bookkeeping) that the embedding Program keeps alive so it can compile
additional function specializations on demand for Program::call, plus the
resolved host_fns signature table used to dispatch host calls.
Fields§
§instructions: Vec<Instr>§registers: Vec<Data>§pools: Pools§instr_src: Vec<InstrSrc>§callsite_registers: Vec<Vec<u16>>§dyn_lib_fns: Vec<DynamicLibFn>§host_fns: Vec<HostFnSig>§allocated_arg_count: usize§allocated_call_depth: usize§sources: Vec<Source>§structs: Vec<Struct>§enums: Vec<EnumType>§functions: Vec<Function>§dyn_libs: Vec<Dynamiclib>§namespaces: FileNamespacesEvery file’s scope, so a later compile against this program resolves a name the way the file it is written in does.
const_registers: FxHashMap<Data, u16>§free_registers: Vec<u16>§indirect_registers: IndirectRegistersThe registers an indirect call passes its arguments in, kept so a later compile against this program uses the same ones.
generics: GenericsThe generic declarations and the instantiations made from them, kept so a later compile against this program (an embedding host calling in, a REPL line) resolves them the same way.
optimize: boolWhether the program was compiled in the release profile, so a later compile against it (an export entry point) uses the same one.
Implementations§
Source§impl CompileOutput
impl CompileOutput
Sourcepub fn require_main(&self)
pub fn require_main(&self)
Reports that the program has no entry point, unless it has one.
Only the entry file’s main counts: an imported module’s own main is
ignored. Compiling a file without one is not an error, which is what
lets candela check pass on a library whose entry has nothing to run;
running, building or embedding the program calls this first.
Auto Trait Implementations§
impl !Freeze for CompileOutput
impl !RefUnwindSafe for CompileOutput
impl !Send for CompileOutput
impl !Sync for CompileOutput
impl Unpin for CompileOutput
impl UnsafeUnpin for CompileOutput
impl UnwindSafe for CompileOutput
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> 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);