Struct ketos::bytecode::Code [] [src]

pub struct Code {
    pub name: Option<Name>,
    pub consts: Box<[Value]>,
    pub code: Box<[u8]>,
    pub kw_params: Box<[Name]>,
    pub n_params: u32,
    pub req_params: u32,
    pub flags: u32,
    pub doc: Option<String>,
}

Represents a compiled bytecode function or expression.

Fields

Code object name, if present; top-level expressions and lambda code values do not have a name.

Const values referenced in bytecode

Function body bytecode

Names of keyword parameters accepted in the order in which they are expected.

Number of positional parameters accepted; this includes optional parameters, but excludes keyword and rest parameters, if accepted. Optional parameter values may be Unbound.

Number of positional parameters which must not be Unbound.

Miscellaneous flags; see code_flags for bit flag values.

Optional documentation string

Methods

impl Code
[src]

Returns the computed arity of the compiled function.

Returns whether the function accepts a rest parameter.

Returns whether the function accepts one or more keyword parameters.

Returns whether all bytecode instructions can be executed without side effects.

Such a code object typically results from compilation of compile-time operators.

Trait Implementations

impl Clone for Code
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Code
[src]

Formats the value using the given formatter.