Struct snarkvm_synthesizer_program::ProgramCore
source · pub struct ProgramCore<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> { /* private fields */ }
Implementations§
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ProgramCore<N, Instruction, Command>
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 structs(&self) -> &IndexMap<Identifier<N>, StructType<N>>
pub const fn structs(&self) -> &IndexMap<Identifier<N>, StructType<N>>
Returns the structs in the program.
sourcepub const fn records(&self) -> &IndexMap<Identifier<N>, RecordType<N>>
pub const fn records(&self) -> &IndexMap<Identifier<N>, RecordType<N>>
Returns the records in the program.
sourcepub const fn closures(
&self
) -> &IndexMap<Identifier<N>, ClosureCore<N, Instruction>>
pub const fn closures( &self ) -> &IndexMap<Identifier<N>, ClosureCore<N, Instruction>>
Returns the closures in the program.
sourcepub const fn functions(
&self
) -> &IndexMap<Identifier<N>, FunctionCore<N, Instruction, Command>>
pub const fn functions( &self ) -> &IndexMap<Identifier<N>, FunctionCore<N, Instruction, Command>>
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<&StructType<N>>
pub fn get_struct(&self, name: &Identifier<N>) -> Result<&StructType<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<ClosureCore<N, Instruction>>
pub fn get_closure( &self, name: &Identifier<N> ) -> Result<ClosureCore<N, Instruction>>
Returns the closure with the given name.
sourcepub fn get_function(
&self,
name: &Identifier<N>
) -> Result<FunctionCore<N, Instruction, Command>>
pub fn get_function( &self, name: &Identifier<N> ) -> Result<FunctionCore<N, Instruction, Command>>
Returns the function with the given name.
sourcepub fn get_function_ref(
&self,
name: &Identifier<N>
) -> Result<&FunctionCore<N, Instruction, Command>>
pub fn get_function_ref( &self, name: &Identifier<N> ) -> Result<&FunctionCore<N, Instruction, Command>>
Returns a reference to the function with the given name.
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ProgramCore<N, Instruction, Command>
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<N: Clone + Network, Instruction: Clone + InstructionTrait<N>, Command: Clone + CommandTrait<N>> Clone for ProgramCore<N, Instruction, Command>
impl<N: Clone + Network, Instruction: Clone + InstructionTrait<N>, Command: Clone + CommandTrait<N>> Clone for ProgramCore<N, Instruction, Command>
source§fn clone(&self) -> ProgramCore<N, Instruction, Command>
fn clone(&self) -> ProgramCore<N, Instruction, Command>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Debug for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Debug for ProgramCore<N, Instruction, Command>
source§impl<'de, N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Deserialize<'de> for ProgramCore<N, Instruction, Command>
impl<'de, N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Deserialize<'de> for ProgramCore<N, Instruction, Command>
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: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Display for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Display for ProgramCore<N, Instruction, Command>
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromBytes for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromBytes for ProgramCore<N, Instruction, Command>
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromStr for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromStr for ProgramCore<N, Instruction, Command>
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Parser for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Parser for ProgramCore<N, Instruction, Command>
source§impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>, Command: PartialEq + CommandTrait<N>> PartialEq for ProgramCore<N, Instruction, Command>
impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>, Command: PartialEq + CommandTrait<N>> PartialEq for ProgramCore<N, Instruction, Command>
source§fn eq(&self, other: &ProgramCore<N, Instruction, Command>) -> bool
fn eq(&self, other: &ProgramCore<N, Instruction, Command>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Serialize for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Serialize for ProgramCore<N, Instruction, Command>
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ToBytes for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ToBytes for ProgramCore<N, Instruction, Command>
source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> TypeName for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> TypeName for ProgramCore<N, Instruction, Command>
impl<N: Eq + Network, Instruction: Eq + InstructionTrait<N>, Command: Eq + CommandTrait<N>> Eq for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> StructuralEq for ProgramCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> StructuralPartialEq for ProgramCore<N, Instruction, Command>
Auto Trait Implementations§
impl<N, Instruction, Command> RefUnwindSafe for ProgramCore<N, Instruction, Command>where Command: RefUnwindSafe, Instruction: RefUnwindSafe, N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe,
impl<N, Instruction, Command> Send for ProgramCore<N, Instruction, Command>where Command: Send, Instruction: Send,
impl<N, Instruction, Command> Sync for ProgramCore<N, Instruction, Command>where Command: Sync, Instruction: Sync,
impl<N, Instruction, Command> Unpin for ProgramCore<N, Instruction, Command>where Command: Unpin, Instruction: Unpin, N: Unpin, <N as Environment>::Field: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin,
impl<N, Instruction, Command> UnwindSafe for ProgramCore<N, Instruction, Command>where Command: UnwindSafe, Instruction: UnwindSafe, 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
§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>,
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.