Skip to main content

state_write

Function state_write 

Source
pub fn state_write<S, R, E>(
    storage: &S,
    operation: impl FnOnce(&mut StateTx<'_, <S as XmtpMlsStorageProvider>::TxQuery>) -> Result<TransactionOutcome<R>, E>,
) -> Result<TransactionOutcome<R>, E>
where S: XmtpMlsStorageProvider, E: From<Error> + From<ConnectionError> + Error,
Expand description

Acquire the cross-process writer before exposing state or keys.

An error rolls back all writes. An explicit rollback is useful for trials; the caller must keep only immutable requirements from such a trial.