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§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a program.
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>> StructuralPartialEq for ProgramCore<N, Instruction, Command>
Auto Trait Implementations§
impl<N, Instruction, Command> Freeze for ProgramCore<N, Instruction, Command>
impl<N, Instruction, Command> RefUnwindSafe for ProgramCore<N, Instruction, Command>where
<N as Environment>::Field: RefUnwindSafe,
Instruction: RefUnwindSafe,
N: RefUnwindSafe,
Command: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N, Instruction, Command> Send for ProgramCore<N, Instruction, Command>
impl<N, Instruction, Command> Sync for ProgramCore<N, Instruction, Command>
impl<N, Instruction, Command> Unpin for ProgramCore<N, Instruction, Command>where
<N as Environment>::Field: Unpin,
Instruction: Unpin,
N: Unpin,
Command: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N, Instruction, Command> UnwindSafe for ProgramCore<N, Instruction, Command>where
<N as Environment>::Field: UnwindSafe,
Instruction: UnwindSafe,
N: UnwindSafe,
Command: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more