pub enum ListenMode {
LibPq,
Grpc {
port: u16,
},
Both {
grpc_port: u16,
},
}Expand description
Specifies which protocols HyperProcess should listen on.
§Examples
use hyperdb_api::{ListenMode, Parameters};
// LibPq only (default) - for full read/write access
let mut params = Parameters::new();
params.set_listen_mode(ListenMode::LibPq);
// gRPC only - for Arrow-based query access
let mut params = Parameters::new();
params.set_listen_mode(ListenMode::Grpc { port: 0 }); // auto-assign port
// Both protocols - libpq for writes, gRPC for Arrow queries
let mut params = Parameters::new();
params.set_listen_mode(ListenMode::Both { grpc_port: 7484 });Variants§
LibPq
PostgreSQL wire protocol only (default).
This is the traditional connection mode that supports all Hyper features including read and write operations.
Grpc
gRPC protocol only.
This mode is optimized for query-only workloads and returns results in Arrow IPC format. Note that gRPC mode does not support write operations.
Set port to 0 to auto-assign an available port.
Both
Both libpq and gRPC protocols.
This mode enables full read/write access via libpq while also providing gRPC access for Arrow-based queries. The libpq port is auto-assigned, while the gRPC port is specified.
Note: When using Both mode, the callback connection returns the libpq
endpoint. Use HyperProcess::grpc_endpoint() to get the gRPC endpoint.
Trait Implementations§
Source§impl Clone for ListenMode
impl Clone for ListenMode
Source§fn clone(&self) -> ListenMode
fn clone(&self) -> ListenMode
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 ListenMode
impl Debug for ListenMode
Source§impl Default for ListenMode
impl Default for ListenMode
Source§fn default() -> ListenMode
fn default() -> ListenMode
Source§impl PartialEq for ListenMode
impl PartialEq for ListenMode
Source§fn eq(&self, other: &ListenMode) -> bool
fn eq(&self, other: &ListenMode) -> bool
self and other values to be equal, and is used by ==.impl Copy for ListenMode
impl Eq for ListenMode
impl StructuralPartialEq for ListenMode
Auto Trait Implementations§
impl Freeze for ListenMode
impl RefUnwindSafe for ListenMode
impl Send for ListenMode
impl Sync for ListenMode
impl Unpin for ListenMode
impl UnsafeUnpin for ListenMode
impl UnwindSafe for ListenMode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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