pub struct ReplicationConfig {
pub mode: TransportMode,
pub cluster_size: usize,
pub enabled: bool,
pub quorum_write_timeout: Duration,
}Expand description
레플리케이션 전체 설정
DbConfig::replication 필드로 전달합니다.
Fields§
§mode: TransportModeTransport 모드: InMemory(default) 또는 Quic
cluster_size: usize클러스터 노드 수 (Quorum 계산용, 기본 1)
enabled: bool레플리케이션 활성화 여부 (기본 false)
quorum_write_timeout: DurationQuorum Write 타임아웃 (기본 5초)
Master가 이 시간 내에 quorum ACK를 받지 못하면 replicate() 에러 반환.
Implementations§
Source§impl ReplicationConfig
impl ReplicationConfig
Sourcepub fn quic(
bind_addr: impl Into<String>,
cert_path: impl Into<String>,
key_path: impl Into<String>,
cluster_size: usize,
) -> Self
pub fn quic( bind_addr: impl Into<String>, cert_path: impl Into<String>, key_path: impl Into<String>, cluster_size: usize, ) -> Self
QUIC 모드 (실제 분산 배포용)
Sourcepub async fn build_transport_async(
&self,
broadcast_tx: Sender<GridMessage>,
) -> Result<Box<dyn Transport>, QuicError>
pub async fn build_transport_async( &self, broadcast_tx: Sender<GridMessage>, ) -> Result<Box<dyn Transport>, QuicError>
Transport 빌드 (비동기)
InMemory→ InMemoryTransport 즉시 반환Quic→ s2n-quic 서버 소켓을 열고 QuicTransport 반환
Sourcepub fn build_inmemory(broadcast_tx: Sender<GridMessage>) -> Box<dyn Transport>
pub fn build_inmemory(broadcast_tx: Sender<GridMessage>) -> Box<dyn Transport>
동기 편의 함수 — InMemory 전용
Quic 모드에서는 build_transport_async()를 사용하세요.
Trait Implementations§
Source§impl Clone for ReplicationConfig
impl Clone for ReplicationConfig
Source§fn clone(&self) -> ReplicationConfig
fn clone(&self) -> ReplicationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplicationConfig
impl Debug for ReplicationConfig
Auto Trait Implementations§
impl Freeze for ReplicationConfig
impl RefUnwindSafe for ReplicationConfig
impl Send for ReplicationConfig
impl Sync for ReplicationConfig
impl Unpin for ReplicationConfig
impl UnsafeUnpin for ReplicationConfig
impl UnwindSafe for ReplicationConfig
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more