Struct snarkvm_compiler::Program
source · [−]pub struct Program<N: Network> { /* private fields */ }
Implementations
sourceimpl<N: Network> Program<N>
impl<N: Network> Program<N>
sourcepub const fn imports(&self) -> &IndexMap<ProgramID<N>, Import<N>>
pub const fn imports(&self) -> &IndexMap<ProgramID<N>, Import<N>>
Returns the imports in the program.
sourcepub const fn mappings(&self) -> &IndexMap<Identifier<N>, Mapping<N>>
pub const fn mappings(&self) -> &IndexMap<Identifier<N>, Mapping<N>>
Returns the mappings in the program.
sourcepub const fn closures(&self) -> &IndexMap<Identifier<N>, Closure<N>>
pub const fn closures(&self) -> &IndexMap<Identifier<N>, Closure<N>>
Returns the closures in the program.
sourcepub const fn functions(&self) -> &IndexMap<Identifier<N>, Function<N>>
pub const fn functions(&self) -> &IndexMap<Identifier<N>, Function<N>>
Returns the functions in the program.
sourcepub fn contains_import(&self, id: &ProgramID<N>) -> bool
pub fn contains_import(&self, id: &ProgramID<N>) -> bool
Returns true
if the program contains an import with the given program ID.
sourcepub fn contains_mapping(&self, name: &Identifier<N>) -> bool
pub fn contains_mapping(&self, name: &Identifier<N>) -> bool
Returns true
if the program contains a mapping with the given name.
sourcepub fn contains_interface(&self, name: &Identifier<N>) -> bool
pub fn contains_interface(&self, name: &Identifier<N>) -> bool
Returns true
if the program contains a interface with the given name.
sourcepub fn contains_record(&self, name: &Identifier<N>) -> bool
pub fn contains_record(&self, name: &Identifier<N>) -> bool
Returns true
if the program contains a record with the given name.
sourcepub fn contains_closure(&self, name: &Identifier<N>) -> bool
pub fn contains_closure(&self, name: &Identifier<N>) -> bool
Returns true
if the program contains a closure with the given name.
sourcepub fn contains_function(&self, name: &Identifier<N>) -> bool
pub fn contains_function(&self, name: &Identifier<N>) -> bool
Returns true
if the program contains a function with the given name.
sourcepub fn get_mapping(&self, name: &Identifier<N>) -> Result<Mapping<N>>
pub fn get_mapping(&self, name: &Identifier<N>) -> Result<Mapping<N>>
Returns the mapping with the given name.
sourcepub fn get_interface(&self, name: &Identifier<N>) -> Result<Interface<N>>
pub fn get_interface(&self, name: &Identifier<N>) -> Result<Interface<N>>
Returns the interface with the given name.
sourcepub fn get_record(&self, name: &Identifier<N>) -> Result<RecordType<N>>
pub fn get_record(&self, name: &Identifier<N>) -> Result<RecordType<N>>
Returns the record with the given name.
sourcepub fn get_closure(&self, name: &Identifier<N>) -> Result<Closure<N>>
pub fn get_closure(&self, name: &Identifier<N>) -> Result<Closure<N>>
Returns the closure with the given name.
sourcepub fn get_function(&self, name: &Identifier<N>) -> Result<Function<N>>
pub fn get_function(&self, name: &Identifier<N>) -> Result<Function<N>>
Returns the function with the given name.
sourceimpl<N: Network> Program<N>
impl<N: Network> Program<N>
sourcepub fn is_reserved_opcode(name: &str) -> bool
pub fn is_reserved_opcode(name: &str) -> bool
Returns true
if the given name is a reserved opcode.
sourcepub fn is_reserved_keyword(name: &Identifier<N>) -> bool
pub fn is_reserved_keyword(name: &Identifier<N>) -> bool
Returns true
if the given name uses a reserved keyword.
sourcepub fn is_coinbase(
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> bool
pub fn is_coinbase(
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> bool
Returns true
if the given program ID and function name corresponds to a coinbase function.
Trait Implementations
sourceimpl<'de, N: Network> Deserialize<'de> for Program<N>
impl<'de, N: Network> Deserialize<'de> for Program<N>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the program from a string or bytes.
sourceimpl<N: PartialEq + Network> PartialEq<Program<N>> for Program<N>
impl<N: PartialEq + Network> PartialEq<Program<N>> for Program<N>
impl<N: Eq + Network> Eq for Program<N>
impl<N: Network> StructuralEq for Program<N>
impl<N: Network> StructuralPartialEq for Program<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Program<N> where
N: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for Program<N>
impl<N> Sync for Program<N>
impl<N> Unpin for Program<N> where
N: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for Program<N> where
N: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more