Struct snarkvm_synthesizer::program::Program
source · pub struct Program<N: Network> { /* private fields */ }Implementations§
source§impl<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_struct(&self, name: &Identifier<N>) -> bool
pub fn contains_struct(&self, name: &Identifier<N>) -> bool
Returns true if the program contains a struct 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_struct(&self, name: &Identifier<N>) -> Result<Struct<N>>
pub fn get_struct(&self, name: &Identifier<N>) -> Result<Struct<N>>
Returns the struct 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.
source§impl<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.
Trait Implementations§
source§impl<'de, N: Network> Deserialize<'de> for Program<N>
impl<'de, N: Network> Deserialize<'de> for Program<N>
source§fn 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.
source§impl<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§
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
source§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.