pub struct PaymentHopData {
pub amount: u128,
pub expiry: u64,
pub payment_preimage: Option<Hash256>,
pub hash_algorithm: HashAlgorithm,
pub funding_tx_hash: Hash256,
pub next_hop: Option<Pubkey>,
pub custom_records: Option<PaymentCustomRecords>,
}Expand description
The data for a single hop in a payment route.
Fields§
§amount: u128The amount of the tlc, <= total amount.
expiry: u64§payment_preimage: Option<Hash256>§hash_algorithm: HashAlgorithm§funding_tx_hash: Hash256§next_hop: Option<Pubkey>§custom_records: Option<PaymentCustomRecords>Implementations§
Source§impl PaymentHopData
impl PaymentHopData
pub fn next_hop(&self) -> Option<Pubkey>
Sourcepub fn trampoline_onion(&self) -> Option<Vec<u8>>
pub fn trampoline_onion(&self) -> Option<Vec<u8>>
Returns the trampoline onion bytes embedded in custom_records, if present.
Sourcepub fn set_trampoline_onion(&mut self, data: Vec<u8>)
pub fn set_trampoline_onion(&mut self, data: Vec<u8>)
Embeds a trampoline onion packet into custom_records.
pub fn serialize(&self) -> Vec<u8> ⓘ
pub fn deserialize(data: &[u8]) -> Option<Self>
Trait Implementations§
Source§impl Clone for PaymentHopData
impl Clone for PaymentHopData
Source§fn clone(&self) -> PaymentHopData
fn clone(&self) -> PaymentHopData
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 PaymentHopData
impl Debug for PaymentHopData
Source§impl Default for PaymentHopData
impl Default for PaymentHopData
Source§fn default() -> PaymentHopData
fn default() -> PaymentHopData
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PaymentHopData
impl<'de> Deserialize<'de> for PaymentHopData
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 From<CurrentPaymentHopData> for PaymentHopData
impl From<CurrentPaymentHopData> for PaymentHopData
Source§fn from(hop: CurrentPaymentHopData) -> Self
fn from(hop: CurrentPaymentHopData) -> Self
Converts to this type from the input type.
Source§impl From<PaymentHopData> for CurrentPaymentHopData
impl From<PaymentHopData> for CurrentPaymentHopData
Source§fn from(hop: PaymentHopData) -> Self
fn from(hop: PaymentHopData) -> Self
Converts to this type from the input type.
Source§impl From<PaymentHopData> for PaymentHopData
impl From<PaymentHopData> for PaymentHopData
Source§fn from(payment_hop_data: PaymentHopData) -> Self
fn from(payment_hop_data: PaymentHopData) -> Self
Converts to this type from the input type.
Source§impl From<PaymentHopData> for PaymentHopData
impl From<PaymentHopData> for PaymentHopData
Source§fn from(payment_hop_data: PaymentHopData) -> Self
fn from(payment_hop_data: PaymentHopData) -> Self
Converts to this type from the input type.
Source§impl PartialEq for PaymentHopData
impl PartialEq for PaymentHopData
Source§impl Serialize for PaymentHopData
impl Serialize for PaymentHopData
impl Eq for PaymentHopData
impl StructuralPartialEq for PaymentHopData
Auto Trait Implementations§
impl Freeze for PaymentHopData
impl RefUnwindSafe for PaymentHopData
impl Send for PaymentHopData
impl Sync for PaymentHopData
impl Unpin for PaymentHopData
impl UnsafeUnpin for PaymentHopData
impl UnwindSafe for PaymentHopData
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