pub trait LabelStorage {
Show 14 methods // Required methods fn get_address_labels( &self ) -> Result<HashMap<String, Vec<String>>, MutinyError>; fn get_invoice_labels( &self ) -> Result<HashMap<Bolt11Invoice, Vec<String>>, MutinyError>; fn get_labels(&self) -> Result<HashMap<String, LabelItem>, MutinyError>; fn get_label( &self, label: impl AsRef<str> ) -> Result<Option<LabelItem>, MutinyError>; fn set_address_labels( &self, address: Address, labels: Vec<String> ) -> Result<(), MutinyError>; fn set_invoice_labels( &self, invoice: Bolt11Invoice, labels: Vec<String> ) -> Result<(), MutinyError>; fn get_contacts(&self) -> Result<HashMap<String, Contact>, MutinyError>; fn get_contact( &self, label: impl AsRef<str> ) -> Result<Option<Contact>, MutinyError>; fn create_contact_from_label( &self, label: impl AsRef<str>, contact: Contact ) -> Result<String, MutinyError>; fn create_new_contact( &self, contact: Contact ) -> Result<String, MutinyError>; fn archive_contact(&self, id: impl AsRef<str>) -> Result<(), MutinyError>; fn edit_contact( &self, id: impl AsRef<str>, contact: Contact ) -> Result<(), MutinyError>; fn get_tag_items(&self) -> Result<Vec<TagItem>, MutinyError>; // Provided method fn get_contact_for_lnurl( &self, lnurl: &LnUrl ) -> Result<Option<String>, MutinyError> { ... }
}

Required Methods§

source

fn get_address_labels( &self ) -> Result<HashMap<String, Vec<String>>, MutinyError>

Get a map of addresses to labels. This can be used to get all the labels for an address

source

fn get_invoice_labels( &self ) -> Result<HashMap<Bolt11Invoice, Vec<String>>, MutinyError>

Get a map of invoices to labels. This can be used to get all the labels for an invoice

source

fn get_labels(&self) -> Result<HashMap<String, LabelItem>, MutinyError>

Get all the existing labels

source

fn get_label( &self, label: impl AsRef<str> ) -> Result<Option<LabelItem>, MutinyError>

Get information about a label

source

fn set_address_labels( &self, address: Address, labels: Vec<String> ) -> Result<(), MutinyError>

Set the labels for an address, replacing any existing labels If you do not want to replace any existing labels, use get_address_labels to get the existing labels, add the new labels, and then use set_address_labels to set the new labels

source

fn set_invoice_labels( &self, invoice: Bolt11Invoice, labels: Vec<String> ) -> Result<(), MutinyError>

Set the labels for an invoice, replacing any existing labels If you do not want to replace any existing labels, use get_invoice_labels to get the existing labels, add the new labels, and then use set_invoice_labels to set the new labels

source

fn get_contacts(&self) -> Result<HashMap<String, Contact>, MutinyError>

Get all the existing contacts

source

fn get_contact( &self, label: impl AsRef<str> ) -> Result<Option<Contact>, MutinyError>

Get a contact by label, the label should be a uuid

source

fn create_contact_from_label( &self, label: impl AsRef<str>, contact: Contact ) -> Result<String, MutinyError>

Create a new contact from an existing label and returns the new identifying label

source

fn create_new_contact(&self, contact: Contact) -> Result<String, MutinyError>

Create a new contact and return the identifying label

source

fn archive_contact(&self, id: impl AsRef<str>) -> Result<(), MutinyError>

Marks a contact as archived

source

fn edit_contact( &self, id: impl AsRef<str>, contact: Contact ) -> Result<(), MutinyError>

Edits an existing contact and replaces the existing contact

source

fn get_tag_items(&self) -> Result<Vec<TagItem>, MutinyError>

Gets all the existing tags (labels and contacts)

Provided Methods§

source

fn get_contact_for_lnurl( &self, lnurl: &LnUrl ) -> Result<Option<String>, MutinyError>

Finds a contact that has the given lnurl as either a lnurl or a lightning address

Object Safety§

This trait is not object safe.

Implementors§