[−][src]Struct ketos::bytecode::Code
Represents a compiled bytecode function or expression.
Fields
name: Option<Name>
Code object name, if present; top-level expressions and lambda code values do not have a name.
consts: Box<[Value]>
Const values referenced in bytecode
code: Box<[u8]>
Function body bytecode
kw_params: Box<[Name]>
Names of keyword parameters accepted in the order in which they are expected.
n_params: u32
Number of positional parameters accepted; this includes optional
parameters, but excludes keyword and rest parameters, if accepted.
Optional parameter values may be Unbound
.
req_params: u32
Number of positional parameters which must not be Unbound
.
flags: u32
Miscellaneous flags; see code_flags
for bit flag values.
doc: Option<String>
Optional documentation string
Methods
impl Code
[src]
pub fn arity(&self) -> Arity
[src]
Returns the computed arity of the compiled function.
pub fn has_rest_params(&self) -> bool
[src]
Returns whether the function accepts a rest parameter.
pub fn has_kw_params(&self) -> bool
[src]
Returns whether the function accepts one or more keyword parameters.
pub fn is_trivial(&self) -> bool
[src]
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
Auto Trait Implementations
impl !RefUnwindSafe for Code
impl !Send for Code
impl !Sync for Code
impl Unpin for Code
impl !UnwindSafe for Code
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,