pub struct Function {
pub name: String,
pub arity: u16,
pub locals_count: u16,
pub code: Vec<Op>,
pub effects: Vec<DeclaredEffect>,
pub body_hash: BodyHash,
pub refinements: Vec<Option<Refinement>>,
}Fields§
§name: String§arity: u16§locals_count: u16§code: Vec<Op>§effects: Vec<DeclaredEffect>Declared effects on this function’s signature (spec §7).
body_hash: BodyHashContent hash of the bytecode body — see compute_body_hash.
Populated at the end of the compile pass; used at Op::MakeClosure
to give every Value::Closure a canonical identity that does not
depend on the closure literal’s source location (#222).
refinements: Vec<Option<Refinement>>Per-parameter refinement predicates (#209 slice 3). Some(r)
for params declared with Type{x | predicate}, None
otherwise. The VM evaluates these at Op::Call time before
pushing the frame; failure raises VmError::RefinementFailed
and the tracer records a verdict event with the same shape
as a runtime gate’s gate.verdict.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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
Mutably borrows from an owned value. Read more