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 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
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)