Struct miden_core::Program 
source · pub struct Program { /* private fields */ }Implementations§
source§impl Program
 
impl Program
Constructors
sourcepub fn new(mast_forest: MastForest, entrypoint: MastNodeId) -> Self
 
pub fn new(mast_forest: MastForest, entrypoint: MastNodeId) -> Self
sourcepub fn with_kernel(
    mast_forest: MastForest,
    entrypoint: MastNodeId,
    kernel: Kernel,
) -> Self
 
pub fn with_kernel( mast_forest: MastForest, entrypoint: MastNodeId, kernel: Kernel, ) -> Self
source§impl Program
 
impl Program
Public accessors
sourcepub fn mast_forest(&self) -> &MastForest
 
pub fn mast_forest(&self) -> &MastForest
Returns the underlying MastForest.
sourcepub fn entrypoint(&self) -> MastNodeId
 
pub fn entrypoint(&self) -> MastNodeId
Returns the entrypoint associated with this program.
sourcepub fn hash(&self) -> RpoDigest
 
pub fn hash(&self) -> RpoDigest
Returns the hash of the program’s entrypoint.
Equivalently, returns the hash of the root of the entrypoint procedure.
sourcepub fn get_node_by_id(&self, node_id: MastNodeId) -> Option<&MastNode>
 
pub fn get_node_by_id(&self, node_id: MastNodeId) -> Option<&MastNode>
Returns the MastNode associated with the provided MastNodeId if valid, or else
None.
This is the faillible version of indexing (e.g. program[node_id]).
sourcepub fn find_procedure_root(&self, digest: RpoDigest) -> Option<MastNodeId>
 
pub fn find_procedure_root(&self, digest: RpoDigest) -> Option<MastNodeId>
Returns the MastNodeId of the procedure root associated with a given digest, if any.
sourcepub fn num_procedures(&self) -> u32
 
pub fn num_procedures(&self) -> u32
Returns the number of procedures in this program.
Trait Implementations§
source§impl Deserializable for Program
 
impl Deserializable for Program
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§impl From<Program> for MastForest
 
impl From<Program> for MastForest
source§impl From<Program> for ProgramInfo
 
impl From<Program> for ProgramInfo
source§impl Index<MastNodeId> for Program
 
impl Index<MastNodeId> for Program
source§impl PrettyPrint for Program
 
impl PrettyPrint for Program
source§fn to_pretty_string(&self) -> String
 
fn to_pretty_string(&self) -> String
source§fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
 
fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Pretty-print this object to the given core::fmt::Formatter. Read more
source§impl Serializable for Program
 
impl Serializable for Program
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 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
impl Eq for Program
impl StructuralPartialEq for Program
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)