FabricCpu

Struct FabricCpu 

Source
pub struct FabricCpu { /* private fields */ }
Expand description

Safe handle to a fabric CPU resource for tasklet dispatch.

Provides the entry point for submitting WASM binaries as CPU tasklets. The underlying TASKLET_SUBMIT op (0x0500) handles WASM loading, fuel-limited execution, and output capture.

Current grafOS tasklet runtimes execute one tasklet thread per submission. Reserving more CPU cores affects available CPU capacity and placement, but does not implicitly make one tasklet invocation multi-threaded.

Implementations§

Source§

impl FabricCpu

Source

pub fn submit<'a>(&'a self, wasm: &'a [u8]) -> TaskletBuilder<'a>

Begin building a CPU tasklet submission.

Returns a TaskletBuilder that can be configured with fuel limits and input data before launching.

§Parameters
  • wasm: The WASM binary to execute as a tasklet.
Source§

impl FabricCpu

Source

pub fn shared_memory_tasklet<S, W>(&self) -> SharedTaskletBuilder<'_, S, W>
where S: Default + Send + Sync + 'static, W: Default + Send + 'static,

Begin building a shared-memory tasklet.

This is a distinct entry point from FabricCpu::submit. Reserving more CPU cores via crate::cpu::CpuBuilder::cores does not by itself produce a multi-worker tasklet — only this builder does.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.