pub struct ClusterConfig {
pub node_id: u32,
pub listen_address: SocketAddr,
pub initial_cluster: Vec<NodeMeta>,
pub db_root_dir: PathBuf,
pub log_dir: PathBuf,
}
Expand description
Cluster node configuration parameters
Encapsulates all essential settings for cluster node initialization and operation, including network settings, storage paths, and cluster topology.
§Defaults
Configuration can be loaded from file with default values generated via serde
’s
default implementations. Field-level defaults use helper functions prefixed with default_
.
Fields§
§node_id: u32
Unique node identifier in cluster
Default: default_node_id()
(typically 0 for single-node setup)
listen_address: SocketAddr
Network listening address (IP:PORT)
Default: default_listen_addr()
(127.0.0.1:8000)
initial_cluster: Vec<NodeMeta>
Seed nodes for cluster initialization
Default: default_initial_cluster()
(empty vector)
§Note
Should contain at least 3 nodes for production deployment
db_root_dir: PathBuf
Database storage root directory
Default: default_db_dir()
(/tmp/db)
log_dir: PathBuf
Log files output directory
Default: default_log_dir()
(./logs)
Implementations§
Trait Implementations§
Source§impl Clone for ClusterConfig
impl Clone for ClusterConfig
Source§fn clone(&self) -> ClusterConfig
fn clone(&self) -> ClusterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClusterConfig
impl Debug for ClusterConfig
Source§impl Default for ClusterConfig
impl Default for ClusterConfig
Source§impl<'de> Deserialize<'de> for ClusterConfig
impl<'de> Deserialize<'de> for ClusterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ClusterConfig
impl RefUnwindSafe for ClusterConfig
impl Send for ClusterConfig
impl Sync for ClusterConfig
impl Unpin for ClusterConfig
impl UnwindSafe for ClusterConfig
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