Struct snarkvm_compiler::Registers
source · [−]pub struct Registers<N: Network, A: Aleo<Network = N>> { /* private fields */ }Implementations
sourceimpl<N: Network, A: Aleo<Network = N>> Registers<N, A>
impl<N: Network, A: Aleo<Network = N>> Registers<N, A>
sourcepub fn load_literal(
&self,
stack: &Stack<N>,
operand: &Operand<N>
) -> Result<Literal<N>>
pub fn load_literal(
&self,
stack: &Stack<N>,
operand: &Operand<N>
) -> Result<Literal<N>>
Loads the literal of a given operand from the registers.
Errors
This method will halt if the given operand is not a literal. This method will halt if the register locator is not found. In the case of register members, this method will halt if the member is not found.
sourceimpl<N: Network, A: Aleo<Network = N>> Registers<N, A>
impl<N: Network, A: Aleo<Network = N>> Registers<N, A>
sourcepub fn load_literal_circuit(
&self,
stack: &Stack<N>,
operand: &Operand<N>
) -> Result<Literal<A>>
pub fn load_literal_circuit(
&self,
stack: &Stack<N>,
operand: &Operand<N>
) -> Result<Literal<A>>
Loads the literal circuit of a given operand from the registers.
Errors
This method will halt if the given operand is not a literal. This method will halt if the register locator is not found. In the case of register members, this method will halt if the member is not found.
sourceimpl<N: Network, A: Aleo<Network = N>> Registers<N, A>
impl<N: Network, A: Aleo<Network = N>> Registers<N, A>
sourcepub fn store_literal(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
literal: Literal<N>
) -> Result<()>
pub fn store_literal(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
literal: Literal<N>
) -> Result<()>
Assigns the given literal to the given register, assuming the register is not already assigned.
Errors
This method will halt if the given register is a register member. This method will halt if the given register is an input register. This method will halt if the register is already used.
sourcepub fn store(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
stack_value: Value<N>
) -> Result<()>
pub fn store(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
stack_value: Value<N>
) -> Result<()>
Assigns the given value to the given register, assuming the register is not already assigned.
Errors
This method will halt if the given register is a register member. This method will halt if the given register is an input register. This method will halt if the register is already used.
sourceimpl<N: Network, A: Aleo<Network = N>> Registers<N, A>
impl<N: Network, A: Aleo<Network = N>> Registers<N, A>
sourcepub fn store_literal_circuit(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
literal: Literal<A>
) -> Result<()>
pub fn store_literal_circuit(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
literal: Literal<A>
) -> Result<()>
Assigns the given literal to the given register, assuming the register is not already assigned.
Errors
This method will halt if the given register is a register member. This method will halt if the given register is an input register. This method will halt if the register is already used.
sourcepub fn store_circuit(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
circuit_value: Value<A>
) -> Result<()>
pub fn store_circuit(
&mut self,
stack: &Stack<N>,
register: &Register<N>,
circuit_value: Value<A>
) -> Result<()>
Assigns the given value to the given register, assuming the register is not already assigned.
Errors
This method will halt if the given register is a register member. This method will halt if the given register is an input register. This method will halt if the register is already used.
sourceimpl<N: Network, A: Aleo<Network = N>> Registers<N, A>
impl<N: Network, A: Aleo<Network = N>> Registers<N, A>
sourcepub fn new(call_stack: CallStack<N>, register_types: RegisterTypes<N>) -> Self
pub fn new(call_stack: CallStack<N>, register_types: RegisterTypes<N>) -> Self
Initializes a new set of registers, given the call stack.
sourcepub fn call_stack(&self) -> CallStack<N>
pub fn call_stack(&self) -> CallStack<N>
Returns the current call stack.
sourcepub fn caller_circuit(&self) -> Result<Address<A>>
pub fn caller_circuit(&self) -> Result<Address<A>>
Returns the transition caller, as a circuit.
sourcepub fn set_caller(&mut self, caller: Address<N>)
pub fn set_caller(&mut self, caller: Address<N>)
Sets the transition caller.
sourcepub fn set_caller_circuit(&mut self, caller_circuit: Address<A>)
pub fn set_caller_circuit(&mut self, caller_circuit: Address<A>)
Sets the transition caller, as a circuit.
sourcepub fn tvk_circuit(&self) -> Result<Field<A>>
pub fn tvk_circuit(&self) -> Result<Field<A>>
Returns the transition view key, as a circuit.
sourcepub fn set_tvk_circuit(&mut self, tvk_circuit: Field<A>)
pub fn set_tvk_circuit(&mut self, tvk_circuit: Field<A>)
Sets the transition view key, as a circuit.
sourcepub fn ensure_console_and_circuit_registers_match(&self) -> Result<()>
pub fn ensure_console_and_circuit_registers_match(&self) -> Result<()>
Ensure the console and circuit registers match.
Trait Implementations
Auto Trait Implementations
impl<N, A> !RefUnwindSafe for Registers<N, A>
impl<N, A> !Send for Registers<N, A>
impl<N, A> !Sync for Registers<N, A>
impl<N, A> Unpin for Registers<N, A> where
N: Unpin,
<A as Environment>::BaseField: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N, A> !UnwindSafe for Registers<N, A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more