pub enum IsolationLevel {
ReadCommitted,
RepeatableRead,
Serializable,
}Expand description
Transaction isolation levels.
Deserialized from the spelling the documentation uses ("serializable",
"read committed"), not from the Rust variant name, so a role_settings
entry reads the same as the environment variable.
Variants§
ReadCommitted
PostgreSQL’s default. A statement sees rows committed before it began.
RepeatableRead
Every statement in the transaction sees the same snapshot.
Serializable
As RepeatableRead, and concurrent transactions are additionally
guaranteed to be equivalent to some serial order. May abort with a
serialization failure, which the client is expected to retry.
Implementations§
Source§impl IsolationLevel
impl IsolationLevel
Sourcepub fn to_sql(&self) -> &'static str
pub fn to_sql(&self) -> &'static str
The spelling PostgreSQL’s SET TRANSACTION ISOLATION LEVEL expects.
Sourcepub fn parse_config(s: &str) -> Option<Self>
pub fn parse_config(s: &str) -> Option<Self>
Parse the spelling used in configuration.
Case-insensitive, and a hyphen, underscore or space separates the words
equally – the documentation writes read committed and an environment
file is as likely to carry read-committed.
Sourcepub fn as_config_str(&self) -> &'static str
pub fn as_config_str(&self) -> &'static str
The inverse of parse_config.
Trait Implementations§
Source§impl Clone for IsolationLevel
impl Clone for IsolationLevel
Source§impl Debug for IsolationLevel
impl Debug for IsolationLevel
Source§impl<'de> Deserialize<'de> for IsolationLevel
impl<'de> Deserialize<'de> for IsolationLevel
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for IsolationLevel
Source§impl PartialEq for IsolationLevel
impl PartialEq for IsolationLevel
Source§impl Serialize for IsolationLevel
impl Serialize 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more