pub struct GlobalSettingsBuilder { /* private fields */ }
Expand description
A global settings builder, used to build GlobalSettings
declaratively with fields validation.
Implementations§
source§impl GlobalSettingsBuilder
impl GlobalSettingsBuilder
pub fn new() -> Self
sourcepub fn with_bootnodes_addresses<T>(self, bootnodes_addresses: Vec<T>) -> Self
pub fn with_bootnodes_addresses<T>(self, bootnodes_addresses: Vec<T>) -> Self
Set the external bootnode address.
sourcepub fn with_network_spawn_timeout(self, timeout: Duration) -> Self
pub fn with_network_spawn_timeout(self, timeout: Duration) -> Self
Set global spawn timeout in seconds.
sourcepub fn with_node_spawn_timeout(self, timeout: Duration) -> Self
pub fn with_node_spawn_timeout(self, timeout: Duration) -> Self
Set individual node spawn timeout in seconds.
sourcepub fn with_local_ip(self, local_ip: &str) -> Self
pub fn with_local_ip(self, local_ip: &str) -> Self
Set local IP used to expose local services (including RPC, metrics and monitoring).
sourcepub fn with_base_dir(self, base_dir: impl Into<PathBuf>) -> Self
pub fn with_base_dir(self, base_dir: impl Into<PathBuf>) -> Self
Set the directory to use as base (instead of a random tmp one).
sourcepub fn build(self) -> Result<GlobalSettings, Vec<Error>>
pub fn build(self) -> Result<GlobalSettings, Vec<Error>>
Seals the builder and returns a GlobalSettings
if there are no validation errors, else returns errors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlobalSettingsBuilder
impl RefUnwindSafe for GlobalSettingsBuilder
impl Send for GlobalSettingsBuilder
impl Sync for GlobalSettingsBuilder
impl Unpin for GlobalSettingsBuilder
impl UnwindSafe for GlobalSettingsBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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