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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for IsolationLevel
Source§impl Debug for IsolationLevel
impl Debug for IsolationLevel
Source§impl Default for IsolationLevel
impl Default for IsolationLevel
Source§fn default() -> IsolationLevel
fn default() -> IsolationLevel
impl Eq for IsolationLevel
Source§impl PartialEq for IsolationLevel
impl PartialEq for IsolationLevel
impl StructuralPartialEq for IsolationLevel
Auto Trait Implementations§
impl Freeze for IsolationLevel
impl RefUnwindSafe for IsolationLevel
impl Send for IsolationLevel
impl Sync for IsolationLevel
impl Unpin for IsolationLevel
impl UnsafeUnpin for IsolationLevel
impl UnwindSafe for IsolationLevel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.