pub struct PaymentSession {
pub request: SendPaymentData,
pub last_error: Option<String>,
pub last_error_code: Option<TlcErrorCode>,
pub try_limit: u32,
pub status: PaymentStatus,
pub created_at: u64,
pub last_updated_at: u64,
pub cached_attempts: Vec<Attempt>,
}Expand description
A payment session tracking the state of a payment attempt.
Fields§
§request: SendPaymentData§last_error: Option<String>§last_error_code: Option<TlcErrorCode>§try_limit: u32For non-MPP, this is the maximum number of single attempt retry limit. For MPP, this is the sum limit of all parts’ retry times.
status: PaymentStatus§created_at: u64§last_updated_at: u64§cached_attempts: Vec<Attempt>Runtime cache for attempts; not persisted.
Implementations§
Source§impl PaymentSession
impl PaymentSession
pub fn update_with_attempt(&mut self, attempt: Attempt)
pub fn retry_times(&self) -> u32
pub fn allow_mpp(&self) -> bool
pub fn payment_hash(&self) -> Hash256
pub fn is_payment_with_router(&self) -> bool
pub fn is_dry_run(&self) -> bool
pub fn attempts(&self) -> Iter<'_, Attempt>
pub fn attempts_count(&self) -> usize
pub fn max_parts(&self) -> usize
pub fn active_attempts(&self) -> Vec<&Attempt>
pub fn fee_paid(&self) -> u128
pub fn remain_fee_amount(&self) -> Option<u128>
pub fn remain_amount(&self) -> u128
pub fn new_attempt( &self, attempt_id: u64, source: Pubkey, target: Pubkey, route_hops: Vec<PaymentHopData>, ) -> Attempt
pub fn append_attempt(&mut self, attempt: Attempt)
pub fn allow_more_attempts(&self) -> bool
pub fn calc_payment_status(&self) -> PaymentStatus
pub fn set_inflight_status(&mut self)
pub fn set_success_status(&mut self)
pub fn set_failed_status(&mut self, error: &str)
Trait Implementations§
Source§impl Clone for PaymentSession
impl Clone for PaymentSession
Source§fn clone(&self) -> PaymentSession
fn clone(&self) -> PaymentSession
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 PaymentSession
impl Debug for PaymentSession
Source§impl<'de> Deserialize<'de> for PaymentSession
impl<'de> Deserialize<'de> for PaymentSession
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
Auto Trait Implementations§
impl !Freeze for PaymentSession
impl RefUnwindSafe for PaymentSession
impl Send for PaymentSession
impl Sync for PaymentSession
impl Unpin for PaymentSession
impl UnsafeUnpin for PaymentSession
impl UnwindSafe for PaymentSession
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