pub struct Invoice { /* private fields */ }Expand description
NB: Invoice fields are non-public since each time we update them we must clear signature
Implementations§
Source§impl Invoice
impl Invoice
Sourcepub fn version(&self) -> &u8
pub fn version(&self) -> &u8
Method borrowing Invoice::version field.
Version byte, always 0 for the initial version
Sourcepub fn amount(&self) -> &AmountExt
pub fn amount(&self) -> &AmountExt
Method borrowing Invoice::amount field.
Amount in the specified asset - a price per single item, if quantity
Sourcepub fn beneficiary(&self) -> &Beneficiary
pub fn beneficiary(&self) -> &Beneficiary
Method borrowing Invoice::beneficiary field.
Main beneficiary. Separating the first beneficiary into a standalone
Sourcepub fn alt_beneficiaries(&self) -> &Vec<Beneficiary>
pub fn alt_beneficiaries(&self) -> &Vec<Beneficiary>
Method borrowing Invoice::alt_beneficiaries field.
List of beneficiary ordered in most desirable-first order, which follow
Sourcepub fn asset(&self) -> &Option<AssetId>
pub fn asset(&self) -> &Option<AssetId>
Method borrowing Invoice::asset field.
AssetId can also be used to define blockchain. If it’s empty it implies
Sourcepub fn expiry(&self) -> &Option<NaiveDateTime>
pub fn expiry(&self) -> &Option<NaiveDateTime>
Method borrowing Invoice::expiry field.
Sourcepub fn recurrent(&self) -> &Recurrent ⓘ
pub fn recurrent(&self) -> &Recurrent ⓘ
Method borrowing Invoice::recurrent field.
Interval between recurrent payments
Sourcepub fn quantity(&self) -> &Option<Quantity>
pub fn quantity(&self) -> &Option<Quantity>
Method borrowing Invoice::quantity field.
Sourcepub fn currency_requirement(&self) -> &Option<CurrencyData>
pub fn currency_requirement(&self) -> &Option<CurrencyData>
Method borrowing Invoice::currency_requirement field.
If the price of the asset provided by fiat provider URL goes below this
Sourcepub fn merchant(&self) -> &Option<String>
pub fn merchant(&self) -> &Option<String>
Method borrowing Invoice::merchant field.
Sourcepub fn purpose(&self) -> &Option<String>
pub fn purpose(&self) -> &Option<String>
Method borrowing Invoice::purpose field.
Sourcepub fn details(&self) -> &Option<Details>
pub fn details(&self) -> &Option<Details>
Method borrowing Invoice::details field.
Sourcepub fn signature(&self) -> &Option<(PublicKey, Signature)>
pub fn signature(&self) -> &Option<(PublicKey, Signature)>
Method borrowing Invoice::signature field.
Sourcepub fn consignment_endpoints(&self) -> &Vec<ConsignmentEndpoint>
pub fn consignment_endpoints(&self) -> &Vec<ConsignmentEndpoint>
Method borrowing Invoice::consignment_endpoints field.
List of nodes which are able to accept RGB consignment
Sourcepub fn unknown(&self) -> &Stream
pub fn unknown(&self) -> &Stream
Method borrowing Invoice::unknown field.
Source§impl Invoice
impl Invoice
pub fn new( beneficiary: Beneficiary, amount: Option<u64>, asset: Option<AssetId>, ) -> Invoice
pub fn with_descriptor( descr: Descriptor<DescriptorPublicKey>, amount: Option<u64>, chain: &Chain, ) -> Invoice
pub fn with_address(address: Address, amount: Option<u64>) -> Invoice
pub fn classify_asset(&self, chain: Option<Chain>) -> AssetClass
pub fn beneficiaries(&self) -> BeneficiariesIter<'_> ⓘ
pub fn set_amount(&mut self, amount: AmountExt) -> bool
pub fn set_recurrent(&mut self, recurrent: Recurrent) -> bool
pub fn set_expiry(&mut self, expiry: NaiveDateTime) -> bool
pub fn set_no_expiry(&mut self) -> bool
pub fn set_quantity(&mut self, quantity: Quantity) -> bool
pub fn remove_quantity(&mut self) -> bool
pub fn set_currency_requirement(&mut self, currency_data: CurrencyData) -> bool
pub fn remove_currency_requirement(&mut self) -> bool
pub fn set_merchant(&mut self, merchant: String) -> bool
pub fn remove_merchant(&mut self) -> bool
pub fn set_purpose(&mut self, purpose: String) -> bool
pub fn remove_purpose(&mut self) -> bool
pub fn set_details(&mut self, details: Details) -> bool
pub fn remove_details(&mut self) -> bool
pub fn signature_hash(&self) -> MerkleNode
pub fn set_signature(&mut self, pubkey: PublicKey, signature: Signature)
pub fn remove_signature(&mut self)
Trait Implementations§
Source§impl Ord for Invoice
impl Ord for Invoice
Source§impl PartialOrd for Invoice
impl PartialOrd for Invoice
Source§impl StrictDecode for Invoice
impl StrictDecode for Invoice
Source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
std::io::Read instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
StrictDecode::strict_decode. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and
StrictDecode::strict_decode to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
path and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed if file contains remaining
data after the object reconstruction.Source§impl StrictEncode for Invoice
impl StrictEncode for Invoice
Source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
std::io::Write instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
StrictEncode::strict_encode
function