lib.rsannotatedlib.rssource40 lines · 1.1 KB · raw
1//! The only crate that may contain `unsafe` (contract §0). It turns
2//! Postgres's C surface into safe types: the single-threaded executor
3//! whose reactor is a `WaitEventSet` (§2), the HTTP/2 client it drives,
4//! and the batch scan that evaluates the extension's functions (§1).
5//!
6//! Every `unsafe` block names the Postgres invariant it relies on.
7
8mod dns;
9mod executor;
10mod guc;
11mod https;
12mod net;
13pub mod owner;
14mod ratelimit;
15mod row;
16pub mod scan;
17pub mod stats;
18
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;
23
24/// A failure outside an HTTP exchange (those are `jev_client`'s
25/// `TransportError`s), which the caller reports as a Postgres ERROR.
26#[derive(Debug)]
27pub enum Error {
28    /// A setting is unusable.
29    Config(String),
30}
31
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 {}