Skip to main content

IsolationLevel

Trait IsolationLevel 

pub trait IsolationLevel:
    Sealed
    + Copy
    + Default
    + Send
    + Sync
    + 'static {
    const NAME: &'static str;
    const REFRESH_SNAPSHOT_PER_STATEMENT: bool;
    const FIRST_COMMITTER_WINS: bool;
    const VALIDATES_READS: bool;
}
Expand description

A transaction isolation level.

Sealed: implementing a new level requires engine support, so this trait is not extensible from outside the crate.

Required Associated Constants§

const NAME: &'static str

Human-readable name, used in traces and error messages.

const REFRESH_SNAPSHOT_PER_STATEMENT: bool

Whether a fresh snapshot is taken before each statement rather than once at begin.

const FIRST_COMMITTER_WINS: bool

Whether the engine must check for write-write conflicts against versions committed after this transaction’s snapshot. False only for ReadCommitted, which re-reads the latest version before writing.

const VALIDATES_READS: bool

Whether reads are recorded and re-checked at commit. True only for Serializable.

A const so the engine’s read path can branch on it and have the branch compiled away — the weaker levels emit no read-recording code, register no SIREAD locks, and allocate nothing.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl IsolationLevel for ReadCommitted

§

const NAME: &'static str = "ReadCommitted"

§

const REFRESH_SNAPSHOT_PER_STATEMENT: bool = true

§

const FIRST_COMMITTER_WINS: bool = false

§

const VALIDATES_READS: bool = false

§

impl IsolationLevel for RepeatableRead

§

const NAME: &'static str = "RepeatableRead"

§

const REFRESH_SNAPSHOT_PER_STATEMENT: bool = false

§

const FIRST_COMMITTER_WINS: bool = true

§

const VALIDATES_READS: bool = false

§

impl IsolationLevel for Serializable

§

const NAME: &'static str = "Serializable"

§

const REFRESH_SNAPSHOT_PER_STATEMENT: bool = false

§

const FIRST_COMMITTER_WINS: bool = true

§

const VALIDATES_READS: bool = true

§

impl IsolationLevel for Snapshot

§

const NAME: &'static str = "Snapshot"

§

const REFRESH_SNAPSHOT_PER_STATEMENT: bool = false

§

const FIRST_COMMITTER_WINS: bool = true

§

const VALIDATES_READS: bool = false