Struct rgbstd::contract::RevealedValue
source · pub struct RevealedValue {
pub value: FungibleState,
pub blinding: BlindingFactor,
}Expand description
State item for a homomorphically-encryptable state.
Consists of the 64-bit value and
Fields§
§value: FungibleStateOriginal value in smallest indivisible units
blinding: BlindingFactorBlinding factor used in Pedersen commitment
Implementations§
source§impl RevealedValue
impl RevealedValue
sourcepub fn new<R>(value: impl Into<FungibleState>, rng: &mut R) -> RevealedValuewhere
R: Rng + RngCore,
pub fn new<R>(value: impl Into<FungibleState>, rng: &mut R) -> RevealedValuewhere R: Rng + RngCore,
Constructs new state using the provided value and random generator for creating blinding factor.
sourcepub fn with(
value: impl Into<FungibleState>,
blinding: impl Into<BlindingFactor>
) -> RevealedValue
pub fn with( value: impl Into<FungibleState>, blinding: impl Into<BlindingFactor> ) -> RevealedValue
Convenience constructor.
Trait Implementations§
source§impl Clone for RevealedValue
impl Clone for RevealedValue
source§fn clone(&self) -> RevealedValue
fn clone(&self) -> RevealedValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl CommitEncode for RevealedValue
impl CommitEncode for RevealedValue
source§fn commit_encode(&self, e: &mut impl Write)
fn commit_encode(&self, e: &mut impl Write)
Encodes the data for the commitment by writing them directly into a
io::Write writer instancesource§impl CommitVerify<RevealedValue, PedersenProtocol> for ConcealedValue
impl CommitVerify<RevealedValue, PedersenProtocol> for ConcealedValue
source§fn commit(revealed: &RevealedValue) -> ConcealedValue
fn commit(revealed: &RevealedValue) -> ConcealedValue
Creates a commitment to a byte representation of a given message
source§impl CommitVerify<RevealedValue, UntaggedProtocol> for PedersenCommitment
impl CommitVerify<RevealedValue, UntaggedProtocol> for PedersenCommitment
source§fn commit(revealed: &RevealedValue) -> PedersenCommitment
fn commit(revealed: &RevealedValue) -> PedersenCommitment
Creates a commitment to a byte representation of a given message
source§impl Conceal for RevealedValue
impl Conceal for RevealedValue
§type Concealed = ConcealedValue
type Concealed = ConcealedValue
The resulting confidential type concealing original data.
source§impl Debug for RevealedValue
impl Debug for RevealedValue
source§impl<'de> Deserialize<'de> for RevealedValue
impl<'de> Deserialize<'de> for RevealedValue
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<RevealedValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<RevealedValue, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl ExposedState for RevealedValue
impl ExposedState for RevealedValue
type Confidential = ConcealedValue
fn state_type(&self) -> StateType
fn state_data(&self) -> StateData
source§impl From<RevealedValue> for FungibleState
impl From<RevealedValue> for FungibleState
source§fn from(revealed: RevealedValue) -> FungibleState
fn from(revealed: RevealedValue) -> FungibleState
Converts to this type from the input type.
source§impl Hash for RevealedValue
impl Hash for RevealedValue
source§impl Ord for RevealedValue
impl Ord for RevealedValue
source§fn cmp(&self, other: &RevealedValue) -> Ordering
fn cmp(&self, other: &RevealedValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<RevealedValue> for RevealedValue
impl PartialEq<RevealedValue> for RevealedValue
source§fn eq(&self, other: &RevealedValue) -> bool
fn eq(&self, other: &RevealedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<RevealedValue> for RevealedValue
impl PartialOrd<RevealedValue> for RevealedValue
source§fn partial_cmp(&self, other: &RevealedValue) -> Option<Ordering>
fn partial_cmp(&self, other: &RevealedValue) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for RevealedValue
impl Serialize for RevealedValue
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,
Serialize this value into the given Serde serializer. Read more
source§impl StrictDecode for RevealedValue
impl StrictDecode for RevealedValue
fn strict_decode( reader: &mut impl TypedRead ) -> Result<RevealedValue, DecodeError>
source§impl StrictDumb for RevealedValue
impl StrictDumb for RevealedValue
fn strict_dumb() -> RevealedValue
source§impl StrictEncode for RevealedValue
impl StrictEncode for RevealedValue
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where W: TypedWrite,
source§impl StrictStruct for RevealedValue
impl StrictStruct for RevealedValue
const ALL_FIELDS: &'static [&'static str] = &["value", "blinding"]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for RevealedValue
impl StrictType for RevealedValue
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB
fn strict_name() -> Option<TypeName>
impl Copy for RevealedValue
impl Eq for RevealedValue
impl StrictProduct for RevealedValue
impl StructuralEq for RevealedValue
impl StructuralPartialEq for RevealedValue
Auto Trait Implementations§
impl RefUnwindSafe for RevealedValue
impl Send for RevealedValue
impl Sync for RevealedValue
impl Unpin for RevealedValue
impl UnwindSafe for RevealedValue
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
Mutably borrows from an owned value. Read more
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.