#[non_exhaustive]pub struct Uri<'a, Extras = NoExtras> {
pub address: Address,
pub amount: Option<Amount>,
pub label: Option<Param<'a>>,
pub message: Option<Param<'a>>,
pub extras: Extras,
}Expand description
Parsed BIP21 URI.
This struct represents all fields of BIP21 URI with the ability to add more extra fields using
the extras field. By default there are no extra fields so an empty implementation is used.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.address: AddressThe address provided in the URI.
This field is mandatory because the address is mandatory in BIP21.
amount: Option<Amount>Number of satoshis requested as payment.
label: Option<Param<'a>>The label of the address - e.g. name of the receiver.
message: Option<Param<'a>>Message that describes the transaction to the user.
extras: ExtrasExtra fields that can occur in a BIP21 URI.
Implementations
sourceimpl<'a, T> Uri<'a, T>
impl<'a, T> Uri<'a, T>
sourcepub fn new(address: Address) -> Selfwhere
T: Default,
pub fn new(address: Address) -> Selfwhere
T: Default,
Creates an URI with defaults.
This sets all fields except address to default values.
They can be overwritten in subsequent assignments before displaying the URI.
sourcepub fn with_extras(address: Address, extras: T) -> Self
pub fn with_extras(address: Address, extras: T) -> Self
Creates an URI with defaults.
This sets all fields except address and extras to default values.
They can be overwritten in subsequent assignments before displaying the URI.
Trait Implementations
sourceimpl<'a, T> Display for Uri<'a, T>where
for<'b> &'b T: SerializeParams,
impl<'a, T> Display for Uri<'a, T>where
for<'b> &'b T: SerializeParams,
sourceimpl<'a, T> FromStr for Uri<'a, T>where
for<'de> T: DeserializeParams<'de>,
impl<'a, T> FromStr for Uri<'a, T>where
for<'de> T: DeserializeParams<'de>,
Warning: this implementation may needlessly allocate, consider using TryFrom<&str> instead.
sourceimpl<'a, T> TryFrom<&'a str> for Uri<'a, T>where
T: DeserializeParams<'a>,
impl<'a, T> TryFrom<&'a str> for Uri<'a, T>where
T: DeserializeParams<'a>,
sourceimpl<'a, T> TryFrom<Cow<'a, str>> for Uri<'a, T>where
T: for<'de> DeserializeParams<'de>,
impl<'a, T> TryFrom<Cow<'a, str>> for Uri<'a, T>where
T: for<'de> DeserializeParams<'de>,
Warning: this implementation may needlessly allocate, consider using TryFrom<&str> instead.
sourceimpl<'a, T> TryFrom<String> for Uri<'a, T>where
for<'de> T: DeserializeParams<'de>,
impl<'a, T> TryFrom<String> for Uri<'a, T>where
for<'de> T: DeserializeParams<'de>,
Warning: this implementation may needlessly allocate, consider using TryFrom<&str> instead.