Struct aleo_rust::snarkvm_types::Program
pub struct Program<N>where
N: Network,{ /* private fields */ }
Implementations§
§impl<N> Program<N>where
N: Network,
impl<N> Program<N>where N: Network,
pub const fn imports(&self) -> &IndexMap<ProgramID<N>, Import<N>, RandomState>
pub const fn imports(&self) -> &IndexMap<ProgramID<N>, Import<N>, RandomState>
Returns the imports in the program.
pub const fn mappings(
&self
) -> &IndexMap<Identifier<N>, Mapping<N>, RandomState>
pub const fn mappings( &self ) -> &IndexMap<Identifier<N>, Mapping<N>, RandomState>
Returns the mappings in the program.
pub const fn closures(
&self
) -> &IndexMap<Identifier<N>, Closure<N>, RandomState>
pub const fn closures( &self ) -> &IndexMap<Identifier<N>, Closure<N>, RandomState>
Returns the closures in the program.
pub const fn functions(
&self
) -> &IndexMap<Identifier<N>, Function<N>, RandomState>
pub const fn functions( &self ) -> &IndexMap<Identifier<N>, Function<N>, RandomState>
Returns the functions in the program.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub fn get_mapping(&self, name: &Identifier<N>) -> Result<Mapping<N>, Error>
pub fn get_mapping(&self, name: &Identifier<N>) -> Result<Mapping<N>, Error>
Returns the mapping with the given name.
pub fn get_struct(&self, name: &Identifier<N>) -> Result<Struct<N>, Error>
pub fn get_struct(&self, name: &Identifier<N>) -> Result<Struct<N>, Error>
Returns the struct with the given name.
pub fn get_record(&self, name: &Identifier<N>) -> Result<RecordType<N>, Error>
pub fn get_record(&self, name: &Identifier<N>) -> Result<RecordType<N>, Error>
Returns the record with the given name.
pub fn get_closure(&self, name: &Identifier<N>) -> Result<Closure<N>, Error>
pub fn get_closure(&self, name: &Identifier<N>) -> Result<Closure<N>, Error>
Returns the closure with the given name.
pub fn get_function(&self, name: &Identifier<N>) -> Result<Function<N>, Error>
pub fn get_function(&self, name: &Identifier<N>) -> Result<Function<N>, Error>
Returns the function with the given name.
§impl<N> Program<N>where
N: Network,
impl<N> Program<N>where N: Network,
pub 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.
pub 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§
§impl<'de, N> Deserialize<'de> for Program<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Program<N>where N: Network,
§fn deserialize<D>(
deserializer: D
) -> Result<Program<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Program<N>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserializes the program from a string or bytes.
§impl<N> PartialEq<Program<N>> for Program<N>where
N: PartialEq<N> + Network,
impl<N> PartialEq<Program<N>> for Program<N>where N: PartialEq<N> + Network,
§impl<N> Serialize for Program<N>where
N: Network,
impl<N> Serialize for Program<N>where N: Network,
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serializes the program into string or bytes.
impl<N> Eq for Program<N>where N: Eq + Network,
impl<N> StructuralEq for Program<N>where N: Network,
impl<N> StructuralPartialEq for Program<N>where N: Network,
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
§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.