pub trait FeeStorage<N>:
Clone
+ Send
+ Syncwhere
N: Network,{
type FeeMap: for<'a> Map<'a, <N as Network>::TransactionID, (<N as Network>::TransitionID, <N as Network>::StateRoot, Option<Proof<N>>)>;
type ReverseFeeMap: for<'a> Map<'a, <N as Network>::TransitionID, <N as Network>::TransactionID>;
type TransitionStorage: TransitionStorage<N>;
Show 16 methods
// Required methods
fn open(
transition_store: TransitionStore<N, Self::TransitionStorage>,
) -> Result<Self, Error>;
fn fee_map(&self) -> &Self::FeeMap;
fn reverse_fee_map(&self) -> &Self::ReverseFeeMap;
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>;
// Provided methods
fn dev(&self) -> Option<u16> { ... }
fn start_atomic(&self) { ... }
fn is_atomic_in_progress(&self) -> bool { ... }
fn atomic_checkpoint(&self) { ... }
fn clear_latest_checkpoint(&self) { ... }
fn atomic_rewind(&self) { ... }
fn abort_atomic(&self) { ... }
fn finish_atomic(&self) -> Result<(), Error> { ... }
fn insert(
&self,
transaction_id: <N as Network>::TransactionID,
fee: &Fee<N>,
) -> Result<(), Error> { ... }
fn remove(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<(), Error> { ... }
fn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<<N as Network>::TransactionID>, Error> { ... }
fn get_fee(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Fee<N>>, Error> { ... }
}Expand description
A trait for fee storage.
Required Associated Types§
Sourcetype FeeMap: for<'a> Map<'a, <N as Network>::TransactionID, (<N as Network>::TransitionID, <N as Network>::StateRoot, Option<Proof<N>>)>
type FeeMap: for<'a> Map<'a, <N as Network>::TransactionID, (<N as Network>::TransitionID, <N as Network>::StateRoot, Option<Proof<N>>)>
The mapping of transaction ID to (fee transition ID, global state root, proof).
Sourcetype ReverseFeeMap: for<'a> Map<'a, <N as Network>::TransitionID, <N as Network>::TransactionID>
type ReverseFeeMap: for<'a> Map<'a, <N as Network>::TransitionID, <N as Network>::TransactionID>
The mapping of fee transition ID to transaction ID.
Sourcetype TransitionStorage: TransitionStorage<N>
type TransitionStorage: TransitionStorage<N>
The transition storage.
Required Methods§
Sourcefn open(
transition_store: TransitionStore<N, Self::TransitionStorage>,
) -> Result<Self, Error>
fn open( transition_store: TransitionStore<N, Self::TransitionStorage>, ) -> Result<Self, Error>
Initializes the fee storage.
Sourcefn reverse_fee_map(&self) -> &Self::ReverseFeeMap
fn reverse_fee_map(&self) -> &Self::ReverseFeeMap
Returns the reverse fee map.
Sourcefn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
Returns the transition storage.
Provided Methods§
Sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
Sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
Sourcefn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
Sourcefn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
Sourcefn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
Sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
Sourcefn finish_atomic(&self) -> Result<(), Error>
fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
Sourcefn insert(
&self,
transaction_id: <N as Network>::TransactionID,
fee: &Fee<N>,
) -> Result<(), Error>
fn insert( &self, transaction_id: <N as Network>::TransactionID, fee: &Fee<N>, ) -> Result<(), Error>
Stores the given (transaction ID, fee) pair into storage.
Sourcefn remove(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<(), Error>
fn remove( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<(), Error>
Removes the fee for the given transaction ID.
Sourcefn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<<N as Network>::TransactionID>, Error>
fn find_transaction_id_from_transition_id( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that contains the given transition ID.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.