MCPcopy Create free account
hub / github.com/HFQR/xitca-web / from_code

Method from_code

postgres/src/error/sql_state.rs:7–12  ·  view source on GitHub ↗

Creates a `SqlState` from its error code.

(s: &str)

Source from the content-addressed store, hash-verified

5impl SqlState {
6 /// Creates a `SqlState` from its error code.
7 pub fn from_code(s: &str) -> SqlState {
8 match Self::state(s) {
9 Some(state) => state,
10 None => SqlState(Inner::Other(s.into())),
11 }
12 }
13
14 /// Returns the error code corresponding to the `SqlState`.
15 pub fn code(&self) -> &str {

Callers

nothing calls this directly

Calls 2

stateFunction · 0.85
SqlStateClass · 0.85

Tested by

no test coverage detected