pub struct CompiledCell { /* private fields */ }Expand description
Persistent compiled cell for the browser binding.
Keeps the compiled [bytecode::Chunk] so timed / repeated runs can call
CompiledCell::run without re-decoding VBC1 bytes. Prefer this over
decode_and_run when the job is “run what we already compiled.”
Implementations§
Source§impl CompiledCell
impl CompiledCell
Sourcepub fn compile(src: &str) -> Result<CompiledCell, JsValue>
pub fn compile(src: &str) -> Result<CompiledCell, JsValue>
Compile a cell expression (= expr) into a handle. Does not run it.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<CompiledCell, JsValue>
pub fn from_bytes(bytes: &[u8]) -> Result<CompiledCell, JsValue>
Decode a VBC1 byte buffer once into a handle. Later Self::run calls
do not decode again.
Sourcepub fn top_locals(&self) -> u16
pub fn top_locals(&self) -> u16
Top-level locals.
Sourcepub fn disassembly(&self) -> String
pub fn disassembly(&self) -> String
Human-readable disassembly of the held chunk (inspect only).
Trait Implementations§
Source§impl From<CompiledCell> for JsValue
impl From<CompiledCell> for JsValue
Source§fn from(value: CompiledCell) -> Self
fn from(value: CompiledCell) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for CompiledCell
impl FromWasmAbi for CompiledCell
Source§impl IntoWasmAbi for CompiledCell
impl IntoWasmAbi for CompiledCell
Source§impl LongRefFromWasmAbi for CompiledCell
impl LongRefFromWasmAbi for CompiledCell
Source§type Abi = WasmPtr<WasmRefCell<CompiledCell>>
type Abi = WasmPtr<WasmRefCell<CompiledCell>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<CompiledCell>
type Anchor = RcRef<CompiledCell>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for CompiledCell
impl OptionFromWasmAbi for CompiledCell
Source§impl OptionIntoWasmAbi for CompiledCell
impl OptionIntoWasmAbi for CompiledCell
Source§impl RefFromWasmAbi for CompiledCell
impl RefFromWasmAbi for CompiledCell
Source§type Abi = WasmPtr<WasmRefCell<CompiledCell>>
type Abi = WasmPtr<WasmRefCell<CompiledCell>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<CompiledCell>
type Anchor = RcRef<CompiledCell>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for CompiledCell
impl RefMutFromWasmAbi for CompiledCell
Source§type Abi = WasmPtr<WasmRefCell<CompiledCell>>
type Abi = WasmPtr<WasmRefCell<CompiledCell>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<CompiledCell>
type Anchor = RcRefMut<CompiledCell>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for CompiledCell
impl SupportsInstanceProperty for CompiledCell
impl SupportsStaticProperty for CompiledCell
Source§impl TryFromJsValue for CompiledCell
impl TryFromJsValue for CompiledCell
Source§impl VectorFromWasmAbi for CompiledCell
impl VectorFromWasmAbi for CompiledCell
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[CompiledCell]>
Source§impl VectorIntoWasmAbi for CompiledCell
impl VectorIntoWasmAbi for CompiledCell
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[CompiledCell]>) -> Self::Abi
Source§impl WasmDescribeVector for CompiledCell
impl WasmDescribeVector for CompiledCell
Auto Trait Implementations§
impl Freeze for CompiledCell
impl RefUnwindSafe for CompiledCell
impl Send for CompiledCell
impl Sync for CompiledCell
impl Unpin for CompiledCell
impl UnsafeUnpin for CompiledCell
impl UnwindSafe for CompiledCell
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.