pub struct FederationConfig {
pub policy: QuorumPolicy,
pub peers: Vec<PeerEndpoint>,
pub client: Client,
pub sender_agent_id: String,
}Expand description
Configured-at-serve federation state. Parsed from
--quorum-writes + --quorum-peers + --quorum-timeout-ms.
Fields§
§policy: QuorumPolicy§peers: Vec<PeerEndpoint>§client: Client§sender_agent_id: StringImplementations§
Source§impl FederationConfig
impl FederationConfig
Sourcepub fn build(
quorum_writes: usize,
peer_urls: &[String],
timeout: Duration,
client_cert_path: Option<&Path>,
client_key_path: Option<&Path>,
ca_cert_path: Option<&Path>,
sender_agent_id: String,
) -> Result<Option<Self>>
pub fn build( quorum_writes: usize, peer_urls: &[String], timeout: Duration, client_cert_path: Option<&Path>, client_key_path: Option<&Path>, ca_cert_path: Option<&Path>, sender_agent_id: String, ) -> Result<Option<Self>>
Build a FederationConfig from the serve-time CLI flags. Returns
None when federation is disabled (quorum_writes == 0 or the
peer list is empty).
§Errors
Returns an error if the reqwest client cannot be constructed with the supplied certificate material.
Sourcepub fn peer_count(&self) -> usize
pub fn peer_count(&self) -> usize
Count of peers in the mesh (excludes the local node). Useful for metrics labels.
Trait Implementations§
Source§impl Clone for FederationConfig
impl Clone for FederationConfig
Source§fn clone(&self) -> FederationConfig
fn clone(&self) -> FederationConfig
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 moreAuto Trait Implementations§
impl Freeze for FederationConfig
impl !RefUnwindSafe for FederationConfig
impl Send for FederationConfig
impl Sync for FederationConfig
impl Unpin for FederationConfig
impl UnsafeUnpin for FederationConfig
impl !UnwindSafe for FederationConfig
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