Trait spacetimedb_durability::History
source · pub trait History {
type TxData;
// Required methods
fn fold_transactions_from<D>(
&self,
offset: TxOffset,
decoder: D
) -> Result<(), D::Error>
where D: Decoder,
D::Error: From<Traversal>;
fn transactions_from<'a, D>(
&self,
offset: TxOffset,
decoder: &'a D
) -> impl Iterator<Item = Result<Transaction<Self::TxData>, D::Error>>
where D: Decoder<Record = Self::TxData>,
D::Error: From<Traversal>,
Self::TxData: 'a;
}
Expand description
Access to the durable history.
The durable history is the sequence of transactions in the order
Durability::append_tx
was called.
Some Durability
implementations will be able to also implement this
trait, but others may not. A database may also use a Durability
implementation to persist transactions, but a separate History
implementation to obtain the history.
Required Associated Types§
Required Methods§
sourcefn fold_transactions_from<D>(
&self,
offset: TxOffset,
decoder: D
) -> Result<(), D::Error>
fn fold_transactions_from<D>( &self, offset: TxOffset, decoder: D ) -> Result<(), D::Error>
Traverse the history of transactions from offset
and “fold” it into
the provided Decoder
.
sourcefn transactions_from<'a, D>(
&self,
offset: TxOffset,
decoder: &'a D
) -> impl Iterator<Item = Result<Transaction<Self::TxData>, D::Error>>
fn transactions_from<'a, D>( &self, offset: TxOffset, decoder: &'a D ) -> impl Iterator<Item = Result<Transaction<Self::TxData>, D::Error>>
Obtain an iterator over the history of transactions, starting from offset
.
Object Safety§
This trait is not object safe.