pub struct FetcherConfig { /* private fields */ }Expand description
Configuration of the Fetcher.
Implementations§
Source§impl FetcherConfig
impl FetcherConfig
Sourcepub fn private(
private: PrivateNetwork,
replicas: ReplicationFactor,
local_node: PublicKey,
) -> FetcherConfig
pub fn private( private: PrivateNetwork, replicas: ReplicationFactor, local_node: PublicKey, ) -> FetcherConfig
Setup a private network FetcherConfig, populating the
FetcherConfig’s seeds with the allowed set from the
PrivateNetwork. It is recommended that
FetcherConfig::with_candidates is not used to extend the candidate
set.
replicas is the target number of seeds the Fetcher should reach
before stopping.
local_node is the NodeId of the local node, to ensure it is
excluded from the Fetcher process.
Sourcepub fn public(
seeds: BTreeSet<PublicKey>,
replicas: ReplicationFactor,
local_node: PublicKey,
) -> FetcherConfig
pub fn public( seeds: BTreeSet<PublicKey>, replicas: ReplicationFactor, local_node: PublicKey, ) -> FetcherConfig
seeds is the target set of preferred seeds that Fetcher should
attempt to fetch from. These are the initial set of candidates nodes –
to add more use FetcherConfig::with_candidates.
replicas is the target number of seeds the Fetcher should reach
before stopping.
local_node is the NodeId of the local node, to ensure it is
excluded from the Fetcher process.
Sourcepub fn with_candidates(
self,
extra: impl IntoIterator<Item = Candidate>,
) -> FetcherConfig
pub fn with_candidates( self, extra: impl IntoIterator<Item = Candidate>, ) -> FetcherConfig
Extend the set of candidate nodes to attempt to fetch from.
Auto Trait Implementations§
impl Freeze for FetcherConfig
impl RefUnwindSafe for FetcherConfig
impl Send for FetcherConfig
impl Sync for FetcherConfig
impl Unpin for FetcherConfig
impl UnwindSafe for FetcherConfig
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> 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>
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>
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