///
/// [`Offer`]: crate::offers::offer::Offer
/// [`Offer::amount`]: crate::offers::offer::Offer::amount
- pub fn amount(&$self) -> Option<&Amount> {
+ pub fn amount(&$self) -> Option<Amount> {
$contents.amount()
}
}
}
- fn amount(&self) -> Option<&Amount> {
+ fn amount(&self) -> Option<Amount> {
match self {
InvoiceContents::ForOffer { invoice_request, .. } =>
invoice_request.inner.offer.amount(),
}
/// The minimum amount required for a successful payment of a single item.
- pub fn amount(&$self) -> Option<&$crate::offers::offer::Amount> {
+ pub fn amount(&$self) -> Option<$crate::offers::offer::Amount> {
$contents.amount()
}
self.metadata.as_ref().and_then(|metadata| metadata.as_bytes())
}
- pub fn amount(&self) -> Option<&Amount> {
- self.amount.as_ref()
+ pub fn amount(&self) -> Option<Amount> {
+ self.amount
}
pub fn description(&self) -> Option<PrintableString> {
/// The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
/// another currency.
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Amount {
/// An amount of bitcoin.
Bitcoin {