Skip to main content

ConnOpts

Struct ConnOpts 

Source
pub struct ConnOpts<'a> {
    pub engine: Arc<RwLock<Engine>>,
    pub tx_gate: TxGate,
    pub expected_password: Option<Zeroizing<String>>,
    pub users: Arc<UserStore>,
    pub shutdown_rx: &'a mut Receiver<bool>,
    pub idle_timeout: Duration,
    pub query_timeout: Duration,
    pub rate_limiter: Option<&'a AuthRateLimiter>,
    pub peer_addr: Option<SocketAddr>,
    pub metrics: Arc<Metrics>,
    pub tx_wait_timeout: Duration,
    pub db_name: Option<String>,
}
Expand description

Options for a single connection, bundled to keep handle_connection’s argument list short.

Fields§

§engine: Arc<RwLock<Engine>>§tx_gate: TxGate§expected_password: Option<Zeroizing<String>>

Expected client password. Wrapped in Zeroizing so the secret is wiped from memory on drop (defends against leaking via a core dump).

§users: Arc<UserStore>

Multi-user store loaded from the data dir at startup. When it has users, the handshake authenticates (username, password) against it; when empty the server falls back to expected_password. Shared across connections.

§shutdown_rx: &'a mut Receiver<bool>§idle_timeout: Duration§query_timeout: Duration§rate_limiter: Option<&'a AuthRateLimiter>§peer_addr: Option<SocketAddr>§metrics: Arc<Metrics>

Shared server metrics. Always present; tests pass Arc::new(Metrics::new()).

§tx_wait_timeout: Duration

How long an explicit begin waits to acquire the transaction gate while another connection holds an open explicit transaction, before giving up with a clear timeout error instead of queueing indefinitely.

§db_name: Option<String>

When Some, the single database name this server serves. A CONNECT that explicitly names a different database is rejected at connect time. None accepts any name (0.9.x behavior) and only warns.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for ConnOpts<'a>

§

impl<'a> Freeze for ConnOpts<'a>

§

impl<'a> RefUnwindSafe for ConnOpts<'a>

§

impl<'a> Send for ConnOpts<'a>

§

impl<'a> Sync for ConnOpts<'a>

§

impl<'a> Unpin for ConnOpts<'a>

§

impl<'a> UnsafeUnpin for ConnOpts<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more