@@ -398,14 +398,14 @@ impl Offer {
398
398
399
399
/// Features pertaining to the offer.
400
400
pub fn features ( & self ) -> & OfferFeatures {
401
- & self . contents . features
401
+ & self . contents . features ( )
402
402
}
403
403
404
404
/// Duration since the Unix epoch when an invoice should no longer be requested.
405
405
///
406
406
/// If `None`, the offer does not expire.
407
407
pub fn absolute_expiry ( & self ) -> Option < Duration > {
408
- self . contents . absolute_expiry
408
+ self . contents . absolute_expiry ( )
409
409
}
410
410
411
411
/// Whether the offer has expired.
@@ -417,13 +417,13 @@ impl Offer {
417
417
/// The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
418
418
/// displayed to the user but with the caveat that it has not been verified in any way.
419
419
pub fn issuer ( & self ) -> Option < PrintableString > {
420
- self . contents . issuer . as_ref ( ) . map ( |issuer| PrintableString ( issuer . as_str ( ) ) )
420
+ self . contents . issuer ( )
421
421
}
422
422
423
423
/// Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
424
424
/// recipient privacy by obfuscating its node id.
425
425
pub fn paths ( & self ) -> & [ BlindedPath ] {
426
- self . contents . paths . as_ref ( ) . map ( |paths| paths . as_slice ( ) ) . unwrap_or ( & [ ] )
426
+ self . contents . paths ( )
427
427
}
428
428
429
429
/// The quantity of items supported.
@@ -551,10 +551,22 @@ impl OfferContents {
551
551
self . metadata . as_ref ( ) . and_then ( |metadata| metadata. as_bytes ( ) )
552
552
}
553
553
554
+ pub fn amount ( & self ) -> Option < & Amount > {
555
+ self . amount . as_ref ( )
556
+ }
557
+
554
558
pub fn description ( & self ) -> PrintableString {
555
559
PrintableString ( & self . description )
556
560
}
557
561
562
+ pub fn features ( & self ) -> & OfferFeatures {
563
+ & self . features
564
+ }
565
+
566
+ pub fn absolute_expiry ( & self ) -> Option < Duration > {
567
+ self . absolute_expiry
568
+ }
569
+
558
570
#[ cfg( feature = "std" ) ]
559
571
pub ( super ) fn is_expired ( & self ) -> bool {
560
572
match self . absolute_expiry {
@@ -566,8 +578,12 @@ impl OfferContents {
566
578
}
567
579
}
568
580
569
- pub fn amount ( & self ) -> Option < & Amount > {
570
- self . amount . as_ref ( )
581
+ pub fn issuer ( & self ) -> Option < PrintableString > {
582
+ self . issuer . as_ref ( ) . map ( |issuer| PrintableString ( issuer. as_str ( ) ) )
583
+ }
584
+
585
+ pub fn paths ( & self ) -> & [ BlindedPath ] {
586
+ self . paths . as_ref ( ) . map ( |paths| paths. as_slice ( ) ) . unwrap_or ( & [ ] )
571
587
}
572
588
573
589
pub ( super ) fn check_amount_msats_for_quantity (
0 commit comments