mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-21 23:22:17 -04:00
Clippy; update doc comments to reflect my #[must_use] newtype
This commit is contained in:
@@ -1263,8 +1263,9 @@ impl MutTxId {
|
||||
(tx_data, tx)
|
||||
}
|
||||
|
||||
/// Returns a [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
/// Returns a [`DatastoreComputeDuration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
pub fn rollback(self) -> DatastoreComputeDuration {
|
||||
// Record metrics for the transaction at the very end,
|
||||
// right before we drop and release the lock.
|
||||
|
||||
@@ -110,8 +110,9 @@ impl TxId {
|
||||
res
|
||||
}
|
||||
|
||||
/// Returns a [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
/// Returns a [`DatastoreComputeDuration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
///
|
||||
/// If this transaction was created by downgrading a [`super::mut_tx::MutTxId`],
|
||||
/// the returned time includes compute time spent in both the original mutable transaction
|
||||
|
||||
@@ -299,8 +299,9 @@ pub trait Tx {
|
||||
type Tx;
|
||||
|
||||
fn begin_tx(&self, workload: Workload) -> Self::Tx;
|
||||
/// Returns a [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
/// Returns a [`DatastoreComputeduration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
fn release_tx(&self, tx: Self::Tx) -> DatastoreComputeDuration;
|
||||
}
|
||||
|
||||
@@ -311,12 +312,14 @@ pub trait MutTx {
|
||||
/// Returns as two values:
|
||||
/// - A [`TxData`] containing all the mutations performed by the TX,
|
||||
/// which can be used to compute incremental queries.
|
||||
/// - A [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
/// - A [`DatastoreComputeduration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
fn commit_mut_tx(&self, tx: Self::MutTx) -> Result<Option<(TxData, DatastoreComputeDuration)>>;
|
||||
#[must_use]
|
||||
/// Returns a [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
|
||||
/// Returns a [`DatastoreComputeDuration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
fn rollback_mut_tx(&self, tx: Self::MutTx) -> DatastoreComputeDuration;
|
||||
}
|
||||
|
||||
|
||||
@@ -618,8 +618,9 @@ impl RelationalDB {
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip_all)]
|
||||
/// Returns a [`Duration`] representing the total time spent performing datastore operations
|
||||
/// during the transaction, for which energy should be charged.
|
||||
/// Returns a [`DatastoreComputeDuration`]
|
||||
/// representing the total time spent performing datastore operations during the transaction,
|
||||
/// for which energy should be charged.
|
||||
pub fn release_tx(&self, tx: Tx) {
|
||||
log::trace!("RELEASE TX");
|
||||
let compute_duration = self.inner.release_tx(tx);
|
||||
|
||||
Reference in New Issue
Block a user