Skip to main content

Crate hopr_ticket_manager

Crate hopr_ticket_manager 

Source
Expand description

Implements complete logic of ticket management in the HOPR protocol.

There are two major parts in the architecture of the ticket management:

  • HoprTicketManager is responsible for managing the incoming ticket queues and ticket redemption.
  • HoprTicketFactory is responsible for managing outgoing ticket indices and creating outgoing tickets.

Usually, they are created together via HoprTicketManager::new_with_factory.

See the HoprTicketManager and HoprTicketFactory documentation for complete details.

Modulesยง

backend ๐Ÿ”’
errors ๐Ÿ”’
factory ๐Ÿ”’
manager ๐Ÿ”’
traits ๐Ÿ”’
utils ๐Ÿ”’

Structsยง

HoprTicketFactory
Keeps track of outgoing ticket indices and provides an interface for creating multihop tickets.
HoprTicketManager
Keeps track of incoming redeemable tickets and provides ticket redemption and neglection operations.
MemoryStore
Simple non-persistent ticket queue store backed by a HashMap and MemoryTicketQueue.
MemoryTicketQueue
Simple in-memory ticket queue implementation using a binary heap.
RedbStore
Implementation of OutgoingIndexStore and TicketQueueStore using redb database and postcard serializer.
RedbTicketQueue
Implementation of TicketQueue using redb database and postcard serializer, associated with the RedbStore.

Enumsยง

TicketManagerError
Errors that can occur in the HoprTicketManager.

Traitsยง

OutgoingIndexStore
Allows loading and saving outgoing ticket indices.
TicketQueue
Backend for the incoming ticket storage (double-ended) queue.
TicketQueueStore
Allows loading ticket queues from a storage.