pub struct ComponentInstance { /* private fields */ }Expand description
A live WebAssembly component instance, ready for invocation.
Wraps the engine-specific instance along with Torvyn metadata (component ID, fuel state).
§Invariants
- Produced by
WasmEngine::instantiate. - The instance is ready for function calls.
- Fuel and memory limits are applied.
§WARM PATH — created once per component, used on every invocation.
Implementations§
Source§impl ComponentInstance
impl ComponentInstance
Sourcepub fn component_id(&self) -> ComponentId
pub fn component_id(&self) -> ComponentId
Returns the component ID for this instance.
§HOT PATH — zero-cost accessor.
Sourcepub fn has_lifecycle(&self) -> bool
pub fn has_lifecycle(&self) -> bool
Returns whether this component exports the lifecycle interface.
Sourcepub fn has_processor(&self) -> bool
pub fn has_processor(&self) -> bool
Returns whether this component exports the processor interface.
Sourcepub fn has_source(&self) -> bool
pub fn has_source(&self) -> bool
Returns whether this component exports the source interface.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComponentInstance
impl !RefUnwindSafe for ComponentInstance
impl Send for ComponentInstance
impl Sync for ComponentInstance
impl Unpin for ComponentInstance
impl UnsafeUnpin for ComponentInstance
impl !UnwindSafe for ComponentInstance
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more