pub enum IsolationLevel {
ReadUncommitted,
ReadCommitted,
RepeatableRead,
Serializable,
}Expand description
Transaction isolation level.
Defines the degree to which one transaction must be isolated from resource or data modifications made by other concurrent transactions.
Variants§
ReadUncommitted
Read uncommitted: Transactions can see uncommitted changes from others. This is the lowest isolation level, providing minimal guarantees. Use with caution - dirty reads, non-repeatable reads, and phantoms possible.
ReadCommitted
Read committed: Transactions only see committed changes from others. This is the default for PostgreSQL. Prevents dirty reads but allows non-repeatable reads and phantoms.
RepeatableRead
Repeatable read: Transactions see a consistent snapshot of the database. Prevents dirty reads and non-repeatable reads, but phantoms are possible in some databases (though not in PostgreSQL).
Serializable
Serializable: Transactions appear to execute sequentially. The highest isolation level, providing complete isolation but potentially requiring retries due to serialization failures.
Implementations§
Trait Implementations§
Source§impl Clone for IsolationLevel
impl Clone for IsolationLevel
Source§fn clone(&self) -> IsolationLevel
fn clone(&self) -> IsolationLevel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more