pub struct RuntimeLoader {
pub provider: AlloyChainProvider,
pub config: Arc<RollupConfig>,
pub cache: LruCache<BlockInfo, RuntimeConfig>,
/* private fields */
}Expand description
The runtime loader.
Fields§
§provider: AlloyChainProviderThe L1 Client
config: Arc<RollupConfig>The rollup config.
cache: LruCache<BlockInfo, RuntimeConfig>Cache mapping BlockInfo to the RuntimeConfig.
If the block hash for the given block info is a mismatch, the runtime config will be reloaded.
Implementations§
Source§impl RuntimeLoader
impl RuntimeLoader
Sourcepub fn new(l1_eth_rpc: Url, config: Arc<RollupConfig>) -> Self
pub fn new(l1_eth_rpc: Url, config: Arc<RollupConfig>) -> Self
Constructs a new RuntimeLoader with the given provider Url.
Sourcepub async fn load_latest(&mut self) -> Result<RuntimeConfig, RuntimeLoaderError>
pub async fn load_latest(&mut self) -> Result<RuntimeConfig, RuntimeLoaderError>
Loads the RuntimeConfig for the latest block.
Sourcepub async fn load(
&mut self,
block_info: BlockInfo,
) -> Result<RuntimeConfig, RuntimeLoaderError>
pub async fn load( &mut self, block_info: BlockInfo, ) -> Result<RuntimeConfig, RuntimeLoaderError>
Loads the RuntimeConfig for the given BlockInfo.
Trait Implementations§
Source§impl Clone for RuntimeLoader
impl Clone for RuntimeLoader
Source§fn clone(&self) -> RuntimeLoader
fn clone(&self) -> RuntimeLoader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RuntimeLoader
impl !RefUnwindSafe for RuntimeLoader
impl Send for RuntimeLoader
impl Sync for RuntimeLoader
impl Unpin for RuntimeLoader
impl !UnwindSafe for RuntimeLoader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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