Struct rgb::contract::value::pedersen::Commitment[][src]

pub struct Commitment(pub [u8; 33]);

A Pedersen commitment

Implementations

impl Commitment[src]

pub fn from_vec(v: Vec<u8, Global>) -> Commitment[src]

Builds a Hash from a byte vector. If the vector is too short, it will be completed by zeroes. If it’s too long, it will be truncated.

pub fn from_pubkey(
    secp: &Secp256k1,
    pk: &PublicKey
) -> Result<Commitment, Error>
[src]

Creates from a pubkey

pub fn to_pubkey(&self, secp: &Secp256k1) -> Result<PublicKey, Error>[src]

Converts a commitment to a public key

impl Commitment[src]

pub fn as_ptr(&self) -> *const u8[src]

Converts the object to a raw pointer for FFI interfacing

pub fn as_mut_ptr(&mut self) -> *mut u8[src]

Converts the object to a mutable raw pointer for FFI interfacing

pub fn len(&self) -> usize[src]

Returns the length of the object as an array

pub fn is_empty(&self) -> bool[src]

Returns whether the object as an array is empty

Trait Implementations

impl Add<Commitment> for Confidential[src]

type Output = Commitment

The resulting type after applying the + operator.

impl AsRef<[u8]> for Commitment[src]

impl Clone for Commitment[src]

impl CommitEncodeWithStrategy for Commitment

type Strategy = UsingStrict

impl Copy for Commitment[src]

impl Debug for Commitment[src]

impl Decodable for Commitment[src]

impl<'de> Deserialize<'de> for Commitment[src]

impl Encodable for Commitment[src]

impl Eq for Commitment[src]

impl From<Commitment> for Bech32[src]

impl Hash for Commitment[src]

impl Index<Range<usize>> for Commitment[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFrom<usize>> for Commitment[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for Commitment[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for Commitment[src]

type Output = [u8]

The returned type after indexing.

impl Index<usize> for Commitment[src]

type Output = u8

The returned type after indexing.

impl Ord for Commitment[src]

impl PartialEq<Commitment> for Commitment[src]

impl PartialOrd<Commitment> for Commitment[src]

impl Serialize for Commitment[src]

impl StrictDecode for Commitment[src]

impl StrictEncode for Commitment[src]

impl TryFrom<Bech32> for Commitment[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsBech32Payload for T where
    T: AsRef<[u8]>, 
[src]

impl<T> Base32Len for T where
    T: AsRef<[u8]>, 
[src]

impl<T> Bech32DataString for T where
    T: AsPayload, 
[src]

impl<T> Bech32ZipString for T where
    T: AsPayload, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'f, T> CheckBase32<Vec<u5, Global>> for T where
    T: AsRef<[u8]>, 
[src]

type Err = Error

Error type if conversion fails

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> FromBech32 for T where
    T: TryFrom<Bech32, Error = Error>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToBase32 for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToBech32 for T where
    T: Into<Bech32> + Clone
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,