pub struct Record<N: Network> { /* private fields */ }
Implementations
sourceimpl<N: Network> Record<N>
impl<N: Network> Record<N>
sourcepub fn new_noop<R: Rng + CryptoRng>(
owner: Address<N>,
rng: &mut R
) -> Result<Self, RecordError>
pub fn new_noop<R: Rng + CryptoRng>(
owner: Address<N>,
rng: &mut R
) -> Result<Self, RecordError>
Returns a new noop record.
sourcepub fn new<R: Rng + CryptoRng>(
owner: Address<N>,
value: AleoAmount,
payload: Payload<N>,
program_id: N::ProgramID,
rng: &mut R
) -> Result<Self, RecordError>
pub fn new<R: Rng + CryptoRng>(
owner: Address<N>,
value: AleoAmount,
payload: Payload<N>,
program_id: N::ProgramID,
rng: &mut R
) -> Result<Self, RecordError>
Returns a new record.
sourcepub fn from(
owner: Address<N>,
value: AleoAmount,
payload: Payload<N>,
program_id: N::ProgramID,
randomizer: N::RecordRandomizer,
record_view_key: N::RecordViewKey
) -> Result<Self, RecordError>
pub fn from(
owner: Address<N>,
value: AleoAmount,
payload: Payload<N>,
program_id: N::ProgramID,
randomizer: N::RecordRandomizer,
record_view_key: N::RecordViewKey
) -> Result<Self, RecordError>
Returns a record from the given inputs.
sourcepub fn decrypt(
decryption_key: &DecryptionKey<N>,
ciphertext: &N::RecordCiphertext
) -> Result<Self, RecordError>
pub fn decrypt(
decryption_key: &DecryptionKey<N>,
ciphertext: &N::RecordCiphertext
) -> Result<Self, RecordError>
Returns a record from the given decryption key and ciphertext.
sourcepub fn value(&self) -> AleoAmount
pub fn value(&self) -> AleoAmount
Returns the record value.
sourcepub fn program_id(&self) -> N::ProgramID
pub fn program_id(&self) -> N::ProgramID
Returns the program id of this record.
sourcepub fn randomizer(&self) -> N::RecordRandomizer
pub fn randomizer(&self) -> N::RecordRandomizer
Returns the randomizer used for the ciphertext.
sourcepub fn record_view_key(&self) -> &N::RecordViewKey
pub fn record_view_key(&self) -> &N::RecordViewKey
Returns the view key of this record.
sourcepub fn commitment(&self) -> N::Commitment
pub fn commitment(&self) -> N::Commitment
Returns the commitment of this record.
sourcepub fn ciphertext(&self) -> &N::RecordCiphertext
pub fn ciphertext(&self) -> &N::RecordCiphertext
Returns this record as ciphertext.
sourcepub fn to_serial_number(
&self,
compute_key: &ComputeKey<N>
) -> Result<N::SerialNumber, RecordError>
pub fn to_serial_number(
&self,
compute_key: &ComputeKey<N>
) -> Result<N::SerialNumber, RecordError>
Returns the serial number of the record, given the compute key corresponding to the record owner.
Trait Implementations
sourceimpl<'de, N: Network> Deserialize<'de> for Record<N>
impl<'de, N: Network> Deserialize<'de> for Record<N>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<N: Network> Eq for Record<N> where
N: Network,
Auto Trait Implementations
impl<N> RefUnwindSafe for Record<N> where
N: RefUnwindSafe,
<N as Network>::ProgramAffineCurve: RefUnwindSafe,
<N as Network>::ProgramID: RefUnwindSafe,
<N as Network>::RecordCiphertext: RefUnwindSafe,
<N as Network>::RecordViewKey: RefUnwindSafe,
impl<N> Send for Record<N>
impl<N> Sync for Record<N>
impl<N> Unpin for Record<N> where
N: Unpin,
<N as Network>::ProgramAffineCurve: Unpin,
<N as Network>::ProgramID: Unpin,
<N as Network>::RecordCiphertext: Unpin,
<N as Network>::RecordViewKey: Unpin,
impl<N> UnwindSafe for Record<N> where
N: UnwindSafe,
<N as Network>::ProgramAffineCurve: UnwindSafe,
<N as Network>::ProgramID: UnwindSafe,
<N as Network>::RecordCiphertext: UnwindSafe,
<N as Network>::RecordViewKey: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more