pub struct BundlePool { /* private fields */ }Expand description
Bundle-scoped pool managing a reusable isolate.
Implementations§
Source§impl BundlePool
impl BundlePool
Sourcepub fn from_bytes(bytes: impl AsRef<[u8]>, options: PoolOptions) -> Result<Self>
pub fn from_bytes(bytes: impl AsRef<[u8]>, options: PoolOptions) -> Result<Self>
Constructs a pool from bundle bytes and options.
Sourcepub fn from_artifact(
artifact: Arc<BundleArtifact>,
options: PoolOptions,
) -> Result<Self>
pub fn from_artifact( artifact: Arc<BundleArtifact>, options: PoolOptions, ) -> Result<Self>
Constructs a pool from a pre-parsed artifact and options.
Sourcepub fn artifact(&self) -> Arc<BundleArtifact>
pub fn artifact(&self) -> Arc<BundleArtifact>
Returns the shared bundle artifact.
Sourcepub fn handle(&self) -> BundleHandle
pub fn handle(&self) -> BundleHandle
Returns a handle that can be used to prepare handler sessions.
Sourcepub fn call_json(
&self,
handler: &HandlerSession,
input: Option<JsonValue>,
) -> Result<ExecutionOutcome>
pub fn call_json( &self, handler: &HandlerSession, input: Option<JsonValue>, ) -> Result<ExecutionOutcome>
Invokes a handler using JSON adapters.
Sourcepub fn call_rawctx(
&self,
handler: &HandlerSession,
inputs: Vec<RawCtxInput>,
) -> Result<ExecutionOutcome>
pub fn call_rawctx( &self, handler: &HandlerSession, inputs: Vec<RawCtxInput>, ) -> Result<ExecutionOutcome>
Invokes a handler using RawCtx adapters.
Sourcepub fn call_default(&self, handler: &HandlerSession) -> Result<ExecutionOutcome>
pub fn call_default(&self, handler: &HandlerSession) -> Result<ExecutionOutcome>
Invokes a handler using the default strategy.
Sourcepub fn resize(&self, new_max_size: usize) -> Result<()>
pub fn resize(&self, new_max_size: usize) -> Result<()>
Adjusts the maximum pool size (no-op for the single-isolate pool).
Sourcepub fn set_desired_size(&self, desired_size: usize) -> Result<()>
pub fn set_desired_size(&self, desired_size: usize) -> Result<()>
Sets the desired steady-state isolate count.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BundlePool
impl !RefUnwindSafe for BundlePool
impl !Send for BundlePool
impl !Sync for BundlePool
impl Unpin for BundlePool
impl !UnwindSafe for BundlePool
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