pub struct ServerConfig {
pub tcp_address: Option<String>,
pub ipc_address: Option<String>,
pub data_path: PathBuf,
pub request_timeout: Duration,
pub max_message_size: usize,
pub retention_policy: RetentionPolicy,
pub compaction_interval: Option<Duration>,
pub transport_workers: usize,
}Expand description
ORMDB Server configuration.
Fields§
§tcp_address: Option<String>TCP address to bind to (e.g., “tcp://0.0.0.0:9000”).
ipc_address: Option<String>IPC address to bind to (e.g., “ipc:///tmp/ormdb.sock”).
data_path: PathBufPath to the database storage directory.
request_timeout: DurationRequest timeout duration.
max_message_size: usizeMaximum message size in bytes.
retention_policy: RetentionPolicyVersion retention policy for compaction.
compaction_interval: Option<Duration>Interval between automatic compaction runs. None disables auto-compaction.
transport_workers: usizeNumber of transport worker loops (AsyncContext instances).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(data_path: impl Into<PathBuf>) -> Self
pub fn new(data_path: impl Into<PathBuf>) -> Self
Create a new server configuration with the given data path.
Sourcepub fn with_tcp_address(self, address: impl Into<String>) -> Self
pub fn with_tcp_address(self, address: impl Into<String>) -> Self
Set the TCP address.
Sourcepub fn without_tcp(self) -> Self
pub fn without_tcp(self) -> Self
Disable TCP transport.
Sourcepub fn with_ipc_address(self, address: impl Into<String>) -> Self
pub fn with_ipc_address(self, address: impl Into<String>) -> Self
Set the IPC address.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Set the request timeout.
Sourcepub fn with_max_message_size(self, size: usize) -> Self
pub fn with_max_message_size(self, size: usize) -> Self
Set the maximum message size.
Sourcepub fn with_retention_policy(self, policy: RetentionPolicy) -> Self
pub fn with_retention_policy(self, policy: RetentionPolicy) -> Self
Set the retention policy for version compaction.
Sourcepub fn with_compaction_interval(self, interval: Duration) -> Self
pub fn with_compaction_interval(self, interval: Duration) -> Self
Set the compaction interval.
Sourcepub fn without_compaction(self) -> Self
pub fn without_compaction(self) -> Self
Disable automatic compaction.
Sourcepub fn with_transport_workers(self, workers: usize) -> Self
pub fn with_transport_workers(self, workers: usize) -> Self
Set the number of transport worker loops.
Sourcepub fn has_transport(&self) -> bool
pub fn has_transport(&self) -> bool
Check if at least one transport is configured.
Sourcepub fn has_compaction(&self) -> bool
pub fn has_compaction(&self) -> bool
Check if automatic compaction is enabled.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.