pub enum Output<N>where
N: Network,{
Constant(Field<N>, Option<Plaintext<N>>),
Public(Field<N>, Option<Plaintext<N>>),
Private(Field<N>, Option<Ciphertext<N>>),
Record(Field<N>, Field<N>, Option<Record<N, Ciphertext<N>>>, Option<Field<N>>),
ExternalRecord(Field<N>),
Future(Field<N>, Option<Future<N>>),
}Expand description
The transition output.
Variants§
Constant(Field<N>, Option<Plaintext<N>>)
The plaintext hash and (optional) plaintext.
Public(Field<N>, Option<Plaintext<N>>)
The plaintext hash and (optional) plaintext.
Private(Field<N>, Option<Ciphertext<N>>)
The ciphertext hash and (optional) ciphertext.
Record(Field<N>, Field<N>, Option<Record<N, Ciphertext<N>>>, Option<Field<N>>)
The commitment, checksum, (optional) record ciphertext, and (optional) sender ciphertext.
ExternalRecord(Field<N>)
The hash of the external record’s (function_id, record, tvk, output index).
Future(Field<N>, Option<Future<N>>)
The future hash and (optional) future.
Implementations§
Source§impl<N> Output<N>where
N: Network,
impl<N> Output<N>where
N: Network,
Sourcepub fn to_transition_leaf(&self, index: u8) -> TransitionLeaf<N>
pub fn to_transition_leaf(&self, index: u8) -> TransitionLeaf<N>
Returns the output as a transition leaf.
Sourcepub const fn record(&self) -> Option<(&Field<N>, &Record<N, Ciphertext<N>>)>
pub const fn record(&self) -> Option<(&Field<N>, &Record<N, Ciphertext<N>>)>
Returns the commitment and record, if the output is a record.
Sourcepub fn into_record(self) -> Option<(Field<N>, Record<N, Ciphertext<N>>)>
pub fn into_record(self) -> Option<(Field<N>, Record<N, Ciphertext<N>>)>
Consumes self and returns the commitment and record, if the output is a record.
Sourcepub const fn commitment(&self) -> Option<&Field<N>>
pub const fn commitment(&self) -> Option<&Field<N>>
Returns the commitment, if the output is a record.
Sourcepub fn into_commitment(self) -> Option<Field<N>>
pub fn into_commitment(self) -> Option<Field<N>>
Returns the commitment, if the output is a record, and consumes self.
Sourcepub fn into_nonce(self) -> Option<Group<N>>
pub fn into_nonce(self) -> Option<Group<N>>
Returns the nonce, if the output is a record, and consumes self.
Sourcepub const fn checksum(&self) -> Option<&Field<N>>
pub const fn checksum(&self) -> Option<&Field<N>>
Returns the checksum, if the output is a record.
Sourcepub fn into_checksum(self) -> Option<Field<N>>
pub fn into_checksum(self) -> Option<Field<N>>
Returns the checksum, if the output is a record, and consumes self.
Sourcepub const fn sender_ciphertext(&self) -> Option<&Field<N>>
pub const fn sender_ciphertext(&self) -> Option<&Field<N>>
Returns the sender ciphertext, if the output is a record.
Sourcepub fn into_sender_ciphertext(self) -> Option<Field<N>>
pub fn into_sender_ciphertext(self) -> Option<Field<N>>
Returns the sender ciphertext, if the output is a record, and consumes self.
Source§impl<N> Output<N>where
N: Network,
impl<N> Output<N>where
N: Network,
Sourcepub fn decrypt_sender_ciphertext(
&self,
account_view_key: &ViewKey<N>,
) -> Result<Option<Address<N>>, Error>
pub fn decrypt_sender_ciphertext( &self, account_view_key: &ViewKey<N>, ) -> Result<Option<Address<N>>, Error>
Returns the sender address, given the account view key of the record owner.
If the output is not a record or does not contain a sender ciphertext, it returns Ok(None).
If the record does not belong to the given account view key, it returns Err.
If the sender ciphertext is malformed or cannot be decrypted, it returns Err.
Source§impl<N> Output<N>where
N: Network,
impl<N> Output<N>where
N: Network,
Sourcepub fn verifier_inputs(&self) -> impl Iterator<Item = <N as Environment>::Field>
pub fn verifier_inputs(&self) -> impl Iterator<Item = <N as Environment>::Field>
Returns the public verifier inputs for the proof.
Trait Implementations§
Source§impl<'de, N> Deserialize<'de> for Output<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Output<N>where
N: Network,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Output<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Output<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the transition output from a string or bytes.
Source§impl<N> FromBytes for Output<N>where
N: Network,
impl<N> FromBytes for Output<N>where
N: Network,
Source§fn read_le<R>(reader: R) -> Result<Output<N>, Error>where
R: Read,
fn read_le<R>(reader: R) -> Result<Output<N>, Error>where
R: Read,
Reads the output from a buffer.
Source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self from a byte array in little-endian order.Source§fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self::from_bytes_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
Self::read_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§impl<N> Serialize for Output<N>where
N: Network,
impl<N> Serialize for Output<N>where
N: Network,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the transition output into string or bytes.
impl<N> Eq for Output<N>
impl<N> StructuralPartialEq for Output<N>where
N: Network,
Auto Trait Implementations§
impl<N> !Freeze for Output<N>
impl<N> RefUnwindSafe for Output<N>where
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Output<N>
impl<N> Sync for Output<N>
impl<N> Unpin for Output<N>where
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N> UnwindSafe for Output<N>where
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
N: UnwindSafe,
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<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.