lib.rsannotatedlib.rssource40 lines · 1.1 KB · raw

The only crate that may contain unsafe (contract §0). It turns Postgres's C surface into safe types: the single-threaded executor whose reactor is a WaitEventSet (§2), the HTTP/2 client it drives, and the batch scan that evaluates the extension's functions (§1).

Every unsafe block names the Postgres invariant it relies on.

8mod dns;
9mod executor;
10mod guc;
11mod https;
12mod net;
13pub mod owner;
14mod ratelimit;
15mod row;
16pub mod scan;
17pub mod stats;
19pub use guc::{StringCheck, define_checked_string};
20pub use executor::{block_on, join_all};
21pub use https::{Backend, Endpoint, HttpsTransport, KeepAlive, stream_limit};
22pub use ratelimit::RateLimit;

A failure outside an HTTP exchange (those are jev_client's TransportErrors), which the caller reports as a Postgres ERROR.

26#[derive(Debug)]
27pub enum Error {

A setting is unusable.

29    Config(String),
30}
32impl std::fmt::Display for Error {
33    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34        match self {
35            Error::Config(e) => f.write_str(e),
36        }
37    }
38}
39
40impl std::error::Error for Error {}