MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / from_str

Method from_str

graphlite/src/txn/isolation.rs:90–98  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

88 type Err = String;
89
90 fn from_str(s: &str) -> Result<Self, Self::Err> {
91 match s.to_uppercase().as_str() {
92 "READ UNCOMMITTED" | "READ_UNCOMMITTED" => Ok(IsolationLevel::ReadUncommitted),
93 "READ COMMITTED" | "READ_COMMITTED" => Ok(IsolationLevel::ReadCommitted),
94 "REPEATABLE READ" | "REPEATABLE_READ" => Ok(IsolationLevel::RepeatableRead),
95 "SERIALIZABLE" => Ok(IsolationLevel::Serializable),
96 _ => Err(format!("Unknown isolation level: {}", s)),
97 }
98 }
99}
100
101/// Convert from AST isolation level to transaction isolation level

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected