pub struct RtFactory<'a, S: Db> { /* private fields */ }Expand description
Create new runtimes with shared code-store, cache and lock.
This factory is capable of spawning agent runtimes and contract runtimes.
The agent and contract runtimes spawned by this factory have a shared CodeStore,
but their individual execution locks (there is one lock for all agents and one lock for all contracts).
Implementations§
Source§impl<'a, S: Db> RtFactory<'a, S>
impl<'a, S: Db> RtFactory<'a, S>
Sourcepub fn with_store(db: &'a S, code_store: CodeStore<S>) -> Self
pub fn with_store(db: &'a S, code_store: CodeStore<S>) -> Self
Creates a new over an existing code store
Sourcepub fn set_cache_size(&mut self, cache_size: NonZeroUsize) -> Result<()>
pub fn set_cache_size(&mut self, cache_size: NonZeroUsize) -> Result<()>
Sets the cache size and initializes the code-store
§Panic
This function will panic, if the code-store has already been initialized.
Sourcepub fn spawn_contract_rt(&mut self) -> Result<ContractRuntime<S>>
pub fn spawn_contract_rt(&mut self) -> Result<ContractRuntime<S>>
Creates a new contract runtime
Sourcepub fn spawn_agent_rt(&mut self) -> Result<AgentRuntime<S>>
pub fn spawn_agent_rt(&mut self) -> Result<AgentRuntime<S>>
Creates a new agent runtime
Auto Trait Implementations§
impl<'a, S> Freeze for RtFactory<'a, S>where
S: Freeze,
impl<'a, S> !RefUnwindSafe for RtFactory<'a, S>
impl<'a, S> Send for RtFactory<'a, S>
impl<'a, S> Sync for RtFactory<'a, S>
impl<'a, S> Unpin for RtFactory<'a, S>where
S: Unpin,
impl<'a, S> UnsafeUnpin for RtFactory<'a, S>where
S: UnsafeUnpin,
impl<'a, S> !UnwindSafe for RtFactory<'a, S>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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