snarkvm_synthesizer_program::traits

Trait StackMatches

Source
pub trait StackMatches<N: Network> {
    // Required methods
    fn matches_value_type(
        &self,
        value: &Value<N>,
        value_type: &ValueType<N>,
    ) -> Result<()>;
    fn matches_register_type(
        &self,
        stack_value: &Value<N>,
        register_type: &RegisterType<N>,
    ) -> Result<()>;
    fn matches_external_record(
        &self,
        record: &Record<N, Plaintext<N>>,
        locator: &Locator<N>,
    ) -> Result<()>;
    fn matches_record(
        &self,
        record: &Record<N, Plaintext<N>>,
        record_name: &Identifier<N>,
    ) -> Result<()>;
    fn matches_plaintext(
        &self,
        plaintext: &Plaintext<N>,
        plaintext_type: &PlaintextType<N>,
    ) -> Result<()>;
    fn matches_future(
        &self,
        future: &Future<N>,
        locator: &Locator<N>,
    ) -> Result<()>;
}

Required Methods§

Source

fn matches_value_type( &self, value: &Value<N>, value_type: &ValueType<N>, ) -> Result<()>

Checks that the given value matches the layout of the value type.

Source

fn matches_register_type( &self, stack_value: &Value<N>, register_type: &RegisterType<N>, ) -> Result<()>

Checks that the given stack value matches the layout of the register type.

Source

fn matches_external_record( &self, record: &Record<N, Plaintext<N>>, locator: &Locator<N>, ) -> Result<()>

Checks that the given record matches the layout of the external record type.

Source

fn matches_record( &self, record: &Record<N, Plaintext<N>>, record_name: &Identifier<N>, ) -> Result<()>

Checks that the given record matches the layout of the record type.

Source

fn matches_plaintext( &self, plaintext: &Plaintext<N>, plaintext_type: &PlaintextType<N>, ) -> Result<()>

Checks that the given plaintext matches the layout of the plaintext type.

Source

fn matches_future(&self, future: &Future<N>, locator: &Locator<N>) -> Result<()>

Checks that the given future matches the layout of the future type.

Implementors§