pub struct ProofOfPayment {
pub peer_quotes: Vec<(EncodedPeerId, PaymentQuote)>,
}
Expand description
The proof of payment for a data payment, only to be used on node side
Fields§
§peer_quotes: Vec<(EncodedPeerId, PaymentQuote)>
Implementations§
Source§impl ProofOfPayment
impl ProofOfPayment
Sourcepub fn digest(&self) -> Vec<(QuoteHash, QuotingMetrics, RewardsAddress)>
pub fn digest(&self) -> Vec<(QuoteHash, QuotingMetrics, RewardsAddress)>
returns a short digest of the proof of payment to use for verification
Sourcepub fn quotes_by_peer(&self, peer_id: &PeerId) -> Vec<&PaymentQuote>
pub fn quotes_by_peer(&self, peer_id: &PeerId) -> Vec<&PaymentQuote>
Returns all quotes by given peer id
Sourcepub fn verify_for(&self, peer_id: PeerId) -> bool
pub fn verify_for(&self, peer_id: PeerId) -> bool
verifies the proof of payment is valid for the given peer id
Sourcepub fn verify_data_type(&self, data_type: u32) -> bool
pub fn verify_data_type(&self, data_type: u32) -> bool
Verifies whether all quotes were made for the expected data type.
Trait Implementations§
Source§impl Clone for ProofOfPayment
impl Clone for ProofOfPayment
Source§fn clone(&self) -> ProofOfPayment
fn clone(&self) -> ProofOfPayment
Returns a duplicate 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 Debug for ProofOfPayment
impl Debug for ProofOfPayment
Source§impl<'de> Deserialize<'de> for ProofOfPayment
impl<'de> Deserialize<'de> for ProofOfPayment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for ProofOfPayment
impl Ord for ProofOfPayment
Source§fn cmp(&self, other: &ProofOfPayment) -> Ordering
fn cmp(&self, other: &ProofOfPayment) -> 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 for ProofOfPayment
impl PartialEq for ProofOfPayment
Source§impl PartialOrd for ProofOfPayment
impl PartialOrd for ProofOfPayment
Source§impl Serialize for ProofOfPayment
impl Serialize for ProofOfPayment
impl Eq for ProofOfPayment
impl StructuralPartialEq for ProofOfPayment
Auto Trait Implementations§
impl Freeze for ProofOfPayment
impl RefUnwindSafe for ProofOfPayment
impl Send for ProofOfPayment
impl Sync for ProofOfPayment
impl Unpin for ProofOfPayment
impl UnwindSafe for ProofOfPayment
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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>
Converts
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>
Converts
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 more