pub struct Parameters { /* private fields */ }Expand description
Parameters for configuring the Hyper server.
When starting a HyperProcess, a set of default parameters are automatically applied
(matching the C++ HyperProcess behavior). You can override these defaults or disable
them entirely by adding the no_default_parameters key (for example
params.set("no_default_parameters", "") via Parameters::set.
§Transport Modes
Use set_transport_mode to control whether Hyper uses
TCP or IPC (Unix Domain Sockets on Unix systems).
§Example
use hyperdb_api::{Parameters, TransportMode};
let mut params = Parameters::new();
params.set("log_file_size_limit", "100k");
params.set_transport_mode(TransportMode::Tcp); // Force TCP instead of IPCImplementations§
Source§impl Parameters
impl Parameters
Sourcepub fn set_transport_mode(&mut self, mode: TransportMode) -> &mut Self
pub fn set_transport_mode(&mut self, mode: TransportMode) -> &mut Self
Sets the transport mode (TCP or IPC/UDS).
By default, HyperProcess uses IPC (Unix Domain Sockets on Unix) for better
performance. Use TransportMode::Tcp if you need TCP connections.
§Example
use hyperdb_api::{Parameters, TransportMode};
let mut params = Parameters::new();
params.set_transport_mode(TransportMode::Tcp); // Use TCP instead of IPCSourcepub fn transport_mode(&self) -> Option<TransportMode>
pub fn transport_mode(&self) -> Option<TransportMode>
Returns the configured transport mode.
Sourcepub fn set_domain_socket_directory(
&mut self,
dir: impl Into<PathBuf>,
) -> &mut Self
pub fn set_domain_socket_directory( &mut self, dir: impl Into<PathBuf>, ) -> &mut Self
Sets a custom domain socket directory (Unix only).
By default, HyperProcess creates sockets in a temporary directory.
Use this to specify a custom location.
Sourcepub fn domain_socket_directory(&self) -> Option<&Path>
pub fn domain_socket_directory(&self) -> Option<&Path>
Returns the configured domain socket directory (Unix only).
Sourcepub fn set(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> &mut Self
pub fn set( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> &mut Self
Sets a parameter value.
§Arguments
key- The parameter name.value- The parameter value (empty string for flags).
Sourcepub fn set_listen_mode(&mut self, mode: ListenMode) -> &mut Self
pub fn set_listen_mode(&mut self, mode: ListenMode) -> &mut Self
Sets the listen mode for the Hyper server.
This controls which protocols the server listens on:
ListenMode::LibPq:PostgreSQLwire protocol only (default)ListenMode::Grpc: gRPC protocol only (query-only, Arrow results)ListenMode::Both: Both protocols enabled
§Example
use hyperdb_api::{ListenMode, Parameters};
let mut params = Parameters::new();
params.set_listen_mode(ListenMode::Grpc { port: 0 }); // Auto-assign portSourcepub fn listen_mode(&self) -> Option<ListenMode>
pub fn listen_mode(&self) -> Option<ListenMode>
Returns the configured listen mode, if any.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns whether the parameters contain the given key.
Trait Implementations§
Source§impl Clone for Parameters
impl Clone for Parameters
Source§fn clone(&self) -> Parameters
fn clone(&self) -> Parameters
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Parameters
impl Debug for Parameters
Source§impl Default for Parameters
impl Default for Parameters
Source§fn default() -> Parameters
fn default() -> Parameters
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnsafeUnpin for Parameters
impl UnwindSafe for Parameters
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request