pub struct Acknowledgement(/* private fields */);Expand description
Unverified packet acknowledgement.
This acknowledgement can be serialized and deserialized to be sent over the wire.
To retrieve useful data, it has to be verified using the public key of its sender.
Implementations§
Source§impl Acknowledgement
impl Acknowledgement
Sourcepub fn verify(
self,
sender_node_key: &OffchainPublicKey,
) -> Result<VerifiedAcknowledgement>
pub fn verify( self, sender_node_key: &OffchainPublicKey, ) -> Result<VerifiedAcknowledgement>
Attempts to verify the acknowledgement given the sender_node_key that sent the acknowledgement.
Sourcepub fn verify_batch<I: IntoIterator<Item = (OffchainPublicKey, Self)>>(
acknowledgements: I,
) -> Vec<Result<VerifiedAcknowledgement>> ⓘ
pub fn verify_batch<I: IntoIterator<Item = (OffchainPublicKey, Self)>>( acknowledgements: I, ) -> Vec<Result<VerifiedAcknowledgement>> ⓘ
Performs batch verification of acknowledgements received from given senders.
For batches of sizes smaller than MIN_BATCH_SIZE or for iterators with an unknown lower bound of size,
the regular sequential verification of each signature is always performed.
For larger batches, this method makes use of the EdDSA batch signature verification algorithm, which more effectively verifies the batch. This is faster than verifying the signatures individually. However, it comes at a cost of not knowing which signature was invalid in the case of a failure.
This method first tries to verify the batch using the batch signature verification, returning a fast successful verification result quickly.
If one or more of the acknowledgements in the batch were invalid, it preforms individual checks for each signature in the batch, returning the vector of results.
These individual signature checks could be sequential or parallel if the rayon feature is enabled.
Trait Implementations§
Source§impl AsRef<[u8]> for Acknowledgement
impl AsRef<[u8]> for Acknowledgement
Source§impl BytesRepresentable for Acknowledgement
impl BytesRepresentable for Acknowledgement
Source§impl Clone for Acknowledgement
impl Clone for Acknowledgement
Source§fn clone(&self) -> Acknowledgement
fn clone(&self) -> Acknowledgement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Acknowledgement
impl Debug for Acknowledgement
Source§impl<'de> Deserialize<'de> for Acknowledgement
impl<'de> Deserialize<'de> for Acknowledgement
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>,
Source§impl PartialEq for Acknowledgement
impl PartialEq for Acknowledgement
Source§impl Serialize for Acknowledgement
impl Serialize for Acknowledgement
Source§impl TryFrom<&[u8]> for Acknowledgement
impl TryFrom<&[u8]> for Acknowledgement
impl Copy for Acknowledgement
impl Eq for Acknowledgement
impl StructuralPartialEq for Acknowledgement
Auto Trait Implementations§
impl Freeze for Acknowledgement
impl RefUnwindSafe for Acknowledgement
impl Send for Acknowledgement
impl Sync for Acknowledgement
impl Unpin for Acknowledgement
impl UnwindSafe for Acknowledgement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToHex for Twhere
T: BytesRepresentable,
impl<T> ToHex for Twhere
T: BytesRepresentable,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)