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

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

A Pedersen commitment

Implementations

impl Commitment

pub fn from_vec(v: Vec<u8>) -> Commitment

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>

Creates from a pubkey

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

Converts a commitment to a public key

impl Commitment

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

Converts the object to a raw pointer for FFI interfacing

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

Converts the object to a mutable raw pointer for FFI interfacing

pub fn len(&self) -> usize

Returns the length of the object as an array

pub fn is_empty(&self) -> bool

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

impl Clone for Commitment

impl CommitEncodeWithStrategy for Commitment[src]

impl Copy for Commitment

impl Debug for Commitment

impl Decodable for Commitment

impl<'de> Deserialize<'de> for Commitment

impl Encodable for Commitment

impl Eq for Commitment

impl From<Commitment> for Bech32[src]

impl Hash for Commitment

impl Index<Range<usize>> for Commitment

type Output = [u8]

The returned type after indexing.

impl Index<RangeFrom<usize>> for Commitment

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for Commitment

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for Commitment

type Output = [u8]

The returned type after indexing.

impl Index<usize> for Commitment

type Output = u8

The returned type after indexing.

impl Ord for Commitment

impl PartialEq<Commitment> for Commitment

impl PartialOrd<Commitment> for Commitment

impl Serialize for Commitment

impl StrictDecode for Commitment[src]

type Error = Error

Implementation-dependent error type

impl StrictEncode for Commitment[src]

type Error = Error

Implementation-dependent error type

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> Base32Len for T where
    T: AsRef<[u8]>, 
[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>> 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>,