Enum snarkvm_wasm::program::Balance
pub enum Balance<N, Private>where
N: Network,
Private: Visibility,{
Public(Integer<N, u64>),
Private(Private),
}Expand description
A value stored in program data.
Variants§
Public(Integer<N, u64>)
A publicly-visible value.
Private(Private)
A private value is encrypted under the account owner’s address.
Implementations§
§impl<N, Private> Balance<N, Private>where
N: Network,
Private: Visibility,
impl<N, Private> Balance<N, Private>where
N: Network,
Private: Visibility,
pub const fn is_private(&self) -> bool
pub const fn is_private(&self) -> bool
Returns true if self is private.
§impl<N> Balance<N, Plaintext<N>>where
N: Network,
impl<N> Balance<N, Plaintext<N>>where
N: Network,
pub fn encrypt_with_randomizer(
&self,
randomizer: &[Field<N>]
) -> Result<Balance<N, Ciphertext<N>>, Error>
pub fn encrypt_with_randomizer(
&self,
randomizer: &[Field<N>]
) -> Result<Balance<N, Ciphertext<N>>, Error>
Encrypts the balance under the given randomizer.
§impl<N> Balance<N, Ciphertext<N>>where
N: Network,
impl<N> Balance<N, Ciphertext<N>>where
N: Network,
Methods from Deref<Target = Integer<N, u64>>§
Trait Implementations§
§impl<N, Private> Clone for Balance<N, Private>where
N: Clone + Network,
Private: Clone + Visibility,
impl<N, Private> Clone for Balance<N, Private>where
N: Clone + Network,
Private: Clone + Visibility,
§impl<N, Private> Equal<Balance<N, Private>> for Balance<N, Private>where
N: Network,
Private: Visibility<Boolean = Boolean<N>>,
impl<N, Private> Equal<Balance<N, Private>> for Balance<N, Private>where
N: Network,
Private: Visibility<Boolean = Boolean<N>>,
§fn is_equal(
&self,
other: &Balance<N, Private>
) -> <Balance<N, Private> as Equal<Balance<N, Private>>>::Output
fn is_equal(
&self,
other: &Balance<N, Private>
) -> <Balance<N, Private> as Equal<Balance<N, Private>>>::Output
Returns true if self and other are equal.
§fn is_not_equal(
&self,
other: &Balance<N, Private>
) -> <Balance<N, Private> as Equal<Balance<N, Private>>>::Output
fn is_not_equal(
&self,
other: &Balance<N, Private>
) -> <Balance<N, Private> as Equal<Balance<N, Private>>>::Output
Returns true if self and other are not equal.
type Output = Boolean<N>
§impl<N, Private> FromBytes for Balance<N, Private>where
N: Network,
Private: Visibility,
impl<N, Private> FromBytes for Balance<N, Private>where
N: Network,
Private: Visibility,
§impl<N, Private> PartialEq<Balance<N, Private>> for Balance<N, Private>where
N: Network,
Private: Visibility<Boolean = Boolean<N>>,
impl<N, Private> PartialEq<Balance<N, Private>> for Balance<N, Private>where
N: Network,
Private: Visibility<Boolean = Boolean<N>>,
§impl<N> ToBits for Balance<N, Ciphertext<N>>where
N: Network,
impl<N> ToBits for Balance<N, Ciphertext<N>>where
N: Network,
§impl<N, Private> ToBytes for Balance<N, Private>where
N: Network,
Private: Visibility,
impl<N, Private> ToBytes for Balance<N, Private>where
N: Network,
Private: Visibility,
impl<N, Private> Eq for Balance<N, Private>where
N: Network,
Private: Visibility<Boolean = Boolean<N>>,
Auto Trait Implementations§
impl<N, Private> RefUnwindSafe for Balance<N, Private>where
N: RefUnwindSafe,
Private: RefUnwindSafe,
impl<N, Private> Send for Balance<N, Private>where
Private: Send,
impl<N, Private> Sync for Balance<N, Private>where
Private: Sync,
impl<N, Private> Unpin for Balance<N, Private>where
N: Unpin,
Private: Unpin,
impl<N, Private> UnwindSafe for Balance<N, Private>where
N: UnwindSafe,
Private: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more