Struct miden_core::Kernel
source · pub struct Kernel(_);
Expand description
A list of procedure hashes defining a VM kernel.
The internally-stored list always has a consistent order, regardless of the order of procedure list used to instantiate a kernel.
Implementations§
source§impl Kernel
impl Kernel
sourcepub fn new(proc_hashes: &[Digest]) -> Self
pub fn new(proc_hashes: &[Digest]) -> Self
Returns a new Kernel instantiated with the specified procedure hashes.
sourcepub fn contains_proc(&self, proc_hash: Digest) -> bool
pub fn contains_proc(&self, proc_hash: Digest) -> bool
Returns true if a procedure with the specified hash belongs to this kernel.
sourcepub fn proc_hashes(&self) -> &[Digest]
pub fn proc_hashes(&self) -> &[Digest]
Returns a list of procedure hashes contained in this kernel.
Trait Implementations§
source§impl Deserializable for Kernel
impl Deserializable for Kernel
source§fn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source
, attempts to deserialize these bytes
into Self
, and returns the result. Read moresource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError>where
R: ByteReader,
fn read_batch_from<R>( source: &mut R, num_elements: usize ) -> Result<Vec<Self, Global>, DeserializationError>where R: ByteReader,
Reads a sequence of bytes from the provided
source
, attempts to deserialize these bytes
into a vector with the specified number of Self
elements, and returns the result. Read moresource§impl PartialEq<Kernel> for Kernel
impl PartialEq<Kernel> for Kernel
source§impl Serializable for Kernel
impl Serializable for Kernel
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self
into bytes and writes these bytes into the target
.source§fn write_batch_into<W>(source: &[Self], target: &mut W)where
W: ByteWriter,
fn write_batch_into<W>(source: &[Self], target: &mut W)where W: ByteWriter,
source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more