pub struct Registers<N, A>{ /* private fields */ }Implementations§
Source§impl<N, A> Registers<N, A>
impl<N, A> Registers<N, A>
Sourcepub fn new(
call_stack: CallStack<N>,
register_types: RegisterTypes<N>,
) -> Registers<N, A>
pub fn new( call_stack: CallStack<N>, register_types: RegisterTypes<N>, ) -> Registers<N, A>
Initializes a new set of registers, given the call stack.
Sourcepub fn ensure_console_and_circuit_registers_match(&self) -> Result<(), Error>
pub fn ensure_console_and_circuit_registers_match(&self) -> Result<(), Error>
Ensure the console and circuit registers match.
Trait Implementations§
Source§impl<N, A> RegistersCall<N> for Registers<N, A>
impl<N, A> RegistersCall<N> for Registers<N, A>
Source§fn call_stack(&self) -> CallStack<N>
fn call_stack(&self) -> CallStack<N>
Returns the current call stack.
Source§impl<N, A> RegistersLoad<N> for Registers<N, A>
impl<N, A> RegistersLoad<N> for Registers<N, A>
Source§fn load(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Value<N>, Error>
fn load( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Value<N>, Error>
Loads the value of a given operand from the registers.
§Errors
This method will halt if the register locator is not found. In the case of register accesses, this method will halt if the access is not found.
Source§fn load_literal(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Literal<N>, Error>
fn load_literal( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Literal<N>, Error>
Source§fn load_plaintext(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Plaintext<N>, Error>
fn load_plaintext( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Plaintext<N>, Error>
Source§impl<N, A> RegistersLoadCircuit<N, A> for Registers<N, A>
impl<N, A> RegistersLoadCircuit<N, A> for Registers<N, A>
Source§fn load_circuit(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Value<A>, Error>
fn load_circuit( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Value<A>, Error>
Loads the value of a given operand from the registers.
§Errors
This method will halt if the register locator is not found. In the case of register accesses, this method will halt if the access is not found.
Source§fn load_literal_circuit(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Literal<A>, Error>
fn load_literal_circuit( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Literal<A>, Error>
Source§fn load_plaintext_circuit(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<Plaintext<A>, Error>
fn load_plaintext_circuit( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<Plaintext<A>, Error>
Source§impl<N, A> RegistersSigner<N> for Registers<N, A>
impl<N, A> RegistersSigner<N> for Registers<N, A>
Source§fn set_signer(&mut self, signer: Address<N>)
fn set_signer(&mut self, signer: Address<N>)
Sets the transition signer.
Source§fn set_caller(&mut self, caller: Address<N>)
fn set_caller(&mut self, caller: Address<N>)
Sets the transition caller.
Source§impl<N, A> RegistersSignerCircuit<N, A> for Registers<N, A>
impl<N, A> RegistersSignerCircuit<N, A> for Registers<N, A>
Source§fn signer_circuit(&self) -> Result<Address<A>, Error>
fn signer_circuit(&self) -> Result<Address<A>, Error>
Returns the transition signer, as a circuit.
Source§fn set_signer_circuit(&mut self, signer_circuit: Address<A>)
fn set_signer_circuit(&mut self, signer_circuit: Address<A>)
Sets the transition signer, as a circuit.
Source§fn caller_circuit(&self) -> Result<Address<A>, Error>
fn caller_circuit(&self) -> Result<Address<A>, Error>
Returns the transition caller, as a circuit.
Source§fn set_caller_circuit(&mut self, caller_circuit: Address<A>)
fn set_caller_circuit(&mut self, caller_circuit: Address<A>)
Sets the transition caller, as a circuit.
Source§fn tvk_circuit(&self) -> Result<Field<A>, Error>
fn tvk_circuit(&self) -> Result<Field<A>, Error>
Returns the transition view key, as a circuit.
Source§fn set_tvk_circuit(&mut self, tvk_circuit: Field<A>)
fn set_tvk_circuit(&mut self, tvk_circuit: Field<A>)
Sets the transition view key, as a circuit.
Source§impl<N, A> RegistersStore<N> for Registers<N, A>
impl<N, A> RegistersStore<N> for Registers<N, A>
Source§fn store(
&mut self,
stack: &(impl StackMatches<N> + StackProgram<N>),
register: &Register<N>,
stack_value: Value<N>,
) -> Result<(), Error>
fn store( &mut self, stack: &(impl StackMatches<N> + StackProgram<N>), register: &Register<N>, stack_value: Value<N>, ) -> Result<(), Error>
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 access. This method will halt if the given register is an input register. This method will halt if the register is already used.
Source§fn store_literal(
&mut self,
stack: &(impl StackMatches<N> + StackProgram<N>),
register: &Register<N>,
literal: Literal<N>,
) -> Result<(), Error>
fn store_literal( &mut self, stack: &(impl StackMatches<N> + StackProgram<N>), register: &Register<N>, literal: Literal<N>, ) -> Result<(), Error>
Source§impl<N, A> RegistersStoreCircuit<N, A> for Registers<N, A>
impl<N, A> RegistersStoreCircuit<N, A> for Registers<N, A>
Source§fn store_circuit(
&mut self,
stack: &(impl StackMatches<N> + StackProgram<N>),
register: &Register<N>,
circuit_value: Value<A>,
) -> Result<(), Error>
fn store_circuit( &mut self, stack: &(impl StackMatches<N> + StackProgram<N>), register: &Register<N>, circuit_value: Value<A>, ) -> Result<(), Error>
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 access. This method will halt if the given register is an input register. This method will halt if the register is already used.
Source§fn store_literal_circuit(
&mut self,
stack: &(impl StackMatches<N> + StackProgram<N>),
register: &Register<N>,
literal: Literal<A>,
) -> Result<(), Error>
fn store_literal_circuit( &mut self, stack: &(impl StackMatches<N> + StackProgram<N>), register: &Register<N>, literal: Literal<A>, ) -> Result<(), Error>
Auto Trait Implementations§
impl<N, A> !Freeze for Registers<N, A>
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 as Environment>::Field: Unpin,
<N as Environment>::Scalar: Unpin,
<N as Environment>::Projective: Unpin,
<A as Environment>::BaseField: Unpin,
N: Unpin,
impl<N, A> !UnwindSafe for Registers<N, A>
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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