pub struct Kernel { /* private fields */ }Expand description
A v3 chain instance: σ + the chain instance hash + a long-lived Vm (so the image cache survives across events).
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub fn from_genesis(chain_image: Image) -> Self
pub fn from_genesis(chain_image: Image) -> Self
Bootstrap from a chain Image.
Sourcepub fn apply(
&mut self,
block: &Block,
gas_per_event: u64,
quota_per_event: u64,
) -> Result<Vec<EventOutcome>, KernelError>
pub fn apply( &mut self, block: &Block, gas_per_event: u64, quota_per_event: u64, ) -> Result<Vec<EventOutcome>, KernelError>
Apply a block. Returns per-event outcomes; the post-block
state-root is available via Kernel::state_root.
Sourcepub fn state_root(&self) -> CapHash
pub fn state_root(&self) -> CapHash
Current state-root.
Sourcepub fn chain_instance_hash(&self) -> CapHash
pub fn chain_instance_hash(&self) -> CapHash
Current chain instance hash (advances monotonically as events land).
Auto Trait Implementations§
impl !Freeze for Kernel
impl !RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnsafeUnpin for Kernel
impl UnwindSafe for Kernel
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.