pub struct PaymentOnionPacket { /* private fields */ }Expand description
An encrypted onion packet for payment routing.
Implementations§
Source§impl PaymentOnionPacket
impl PaymentOnionPacket
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume self and return the raw data as bytes (alias for into_data()).
Sourcepub fn into_sphinx_onion_packet(self) -> Result<OnionPacket, OnionPacketError>
pub fn into_sphinx_onion_packet(self) -> Result<OnionPacket, OnionPacketError>
Convert into the raw Sphinx onion packet.
Sourcepub fn peel<C: Verification>(
self,
peeler: &Privkey,
assoc_data: Option<&[u8]>,
secp_ctx: &Secp256k1<C>,
) -> Result<PeeledPaymentOnionPacket, OnionPacketError>
pub fn peel<C: Verification>( self, peeler: &Privkey, assoc_data: Option<&[u8]>, secp_ctx: &Secp256k1<C>, ) -> Result<PeeledPaymentOnionPacket, OnionPacketError>
Peels the next layer of the onion packet using the privkey of the current node.
Returns errors when:
- This is the packet for the last hop.
- Fail to peel the packet using the given private key.
Trait Implementations§
Source§impl Clone for PaymentOnionPacket
impl Clone for PaymentOnionPacket
Source§fn clone(&self) -> PaymentOnionPacket
fn clone(&self) -> PaymentOnionPacket
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 PaymentOnionPacket
impl Debug for PaymentOnionPacket
Source§impl<'de> Deserialize<'de> for PaymentOnionPacket
impl<'de> Deserialize<'de> for PaymentOnionPacket
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 Hash for PaymentOnionPacket
impl Hash for PaymentOnionPacket
Source§impl PartialEq for PaymentOnionPacket
impl PartialEq for PaymentOnionPacket
Source§impl Serialize for PaymentOnionPacket
impl Serialize for PaymentOnionPacket
impl Eq for PaymentOnionPacket
impl StructuralPartialEq for PaymentOnionPacket
Auto Trait Implementations§
impl Freeze for PaymentOnionPacket
impl RefUnwindSafe for PaymentOnionPacket
impl Send for PaymentOnionPacket
impl Sync for PaymentOnionPacket
impl Unpin for PaymentOnionPacket
impl UnsafeUnpin for PaymentOnionPacket
impl UnwindSafe for PaymentOnionPacket
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