Struct snarkvm_circuit::Record
source · [−]pub struct Record<A, Private> where
A: Aleo,
Private: Visibility<A>, { /* private fields */ }
Implementations
sourceimpl<A> Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> Record<A, Ciphertext<A>> where
A: Aleo,
sourcepub fn decrypt(&self, view_key: &ViewKey<A>) -> Record<A, Plaintext<A>>
pub fn decrypt(&self, view_key: &ViewKey<A>) -> Record<A, Plaintext<A>>
Decrypts self
into a plaintext record using the given view key & nonce.
sourcepub fn decrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Plaintext<A>>
pub fn decrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Plaintext<A>>
Decrypts self
into a plaintext record using the given record view key.
sourceimpl<A> Record<A, Plaintext<A>> where
A: Aleo,
impl<A> Record<A, Plaintext<A>> where
A: Aleo,
sourcepub fn encrypt(&self, randomizer: &Scalar<A>) -> Record<A, Ciphertext<A>>
pub fn encrypt(&self, randomizer: &Scalar<A>) -> Record<A, Ciphertext<A>>
Encrypts self
for the record owner under the given randomizer.
sourcepub fn encrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Ciphertext<A>>
pub fn encrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Ciphertext<A>>
Encrypts self
under the given record view key.
sourceimpl<A> Record<A, Plaintext<A>> where
A: Aleo,
impl<A> Record<A, Plaintext<A>> where
A: Aleo,
sourcepub fn to_commitment(
&self,
program_id: &ProgramID<A>,
record_name: &Identifier<A>
) -> Field<A>
pub fn to_commitment(
&self,
program_id: &ProgramID<A>,
record_name: &Identifier<A>
) -> Field<A>
Returns the record commitment.
sourceimpl<A> Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> Record<A, Ciphertext<A>> where
A: Aleo,
sourcepub fn to_commitment(
&self,
_program_id: &ProgramID<A>,
_record_name: &Identifier<A>
) -> Field<A>
pub fn to_commitment(
&self,
_program_id: &ProgramID<A>,
_record_name: &Identifier<A>
) -> Field<A>
Returns the record commitment.
sourceimpl<A, Private> Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
sourcepub fn from_plaintext(
owner: Owner<A, Plaintext<A>>,
gates: Balance<A, Plaintext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Plaintext<A>>, Error>
pub fn from_plaintext(
owner: Owner<A, Plaintext<A>>,
gates: Balance<A, Plaintext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Plaintext<A>>, Error>
Initializes a new record plaintext.
sourcepub fn from_ciphertext(
owner: Owner<A, Ciphertext<A>>,
gates: Balance<A, Ciphertext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Ciphertext<A>>, Error>
pub fn from_ciphertext(
owner: Owner<A, Ciphertext<A>>,
gates: Balance<A, Ciphertext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Ciphertext<A>>, Error>
Initializes a new record ciphertext.
sourceimpl<A, Private> Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
sourcepub const fn data(
&self
) -> &IndexMap<Identifier<A>, Entry<A, Private>, RandomState>
pub const fn data(
&self
) -> &IndexMap<Identifier<A>, Entry<A, Private>, RandomState>
Returns the program data.
Trait Implementations
sourceimpl<A, Private> Clone for Record<A, Private> where
A: Clone + Aleo,
Private: Clone + Visibility<A>,
impl<A, Private> Clone for Record<A, Private> where
A: Clone + Aleo,
Private: Clone + Visibility<A>,
sourceimpl<A> Eject for Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> Eject for Record<A, Ciphertext<A>> where
A: Aleo,
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
sourcefn eject_value(&self) -> <Record<A, Ciphertext<A>> as Eject>::Primitive
fn eject_value(&self) -> <Record<A, Ciphertext<A>> as Eject>::Primitive
Ejects the record.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
sourcefn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type. Read more
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns true
if the circuit is a constant. Read more
sourcefn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns true
if the circuit is a private. Read more
sourceimpl<A> Eject for Record<A, Plaintext<A>> where
A: Aleo,
impl<A> Eject for Record<A, Plaintext<A>> where
A: Aleo,
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
type Primitive = Record<<A as Environment>::Network, Plaintext<<A as Environment>::Network>>
sourcefn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type. Read more
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns true
if the circuit is a constant. Read more
sourcefn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns true
if the circuit is a private. Read more
sourceimpl<A, Private> Equal<Record<A, Private>> for Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Equal<Record<A, Private>> for Record<A, Private> where
A: Aleo,
Private: Visibility<A>,
sourcefn is_equal(
&self,
other: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
fn is_equal(
&self,
other: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
Returns true
if self
and other
are equal.
Note: This method does not check the nonce
equality.
sourcefn is_not_equal(
&self,
other: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
fn is_not_equal(
&self,
other: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
Returns true
if self
and other
are not equal.
Note: This method does not check the nonce
equality.
type Output = Boolean<A>
sourceimpl<A> Inject for Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> Inject for Record<A, Ciphertext<A>> where
A: Aleo,
sourcefn new(
Mode,
record: <Record<A, Ciphertext<A>> as Inject>::Primitive
) -> Record<A, Ciphertext<A>>
fn new(
Mode,
record: <Record<A, Ciphertext<A>> as Inject>::Primitive
) -> Record<A, Ciphertext<A>>
Initializes a ciphertext record from a primitive.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
sourceimpl<A> Inject for Record<A, Plaintext<A>> where
A: Aleo,
impl<A> Inject for Record<A, Plaintext<A>> where
A: Aleo,
sourceimpl<A> ToBits for Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> ToBits for Record<A, Ciphertext<A>> where
A: Aleo,
sourcefn to_bits_le(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_bits_le(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns this data as a list of little-endian bits.
sourcefn to_bits_be(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_bits_be(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
sourceimpl<A> ToBits for Record<A, Plaintext<A>> where
A: Aleo,
impl<A> ToBits for Record<A, Plaintext<A>> where
A: Aleo,
sourcefn to_bits_le(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_bits_le(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns this data as a list of little-endian bits.
sourcefn to_bits_be(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_bits_be(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
sourceimpl<A> ToFields for Record<A, Ciphertext<A>> where
A: Aleo,
impl<A> ToFields for Record<A, Ciphertext<A>> where
A: Aleo,
Auto Trait Implementations
impl<A, Private> RefUnwindSafe for Record<A, Private> where
Private: RefUnwindSafe,
<A as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
impl<A, Private> !Send for Record<A, Private>
impl<A, Private> !Sync for Record<A, Private>
impl<A, Private> Unpin for Record<A, Private> where
Private: Unpin,
<A as Environment>::BaseField: Unpin,
impl<A, Private> UnwindSafe for Record<A, Private> where
Private: UnwindSafe,
<A as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
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