pub struct ConfigBuilder { /* private fields */ }Expand description
A builder for building a configuration set for a Koibumi Bitmessage node.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn core(&mut self, core: CoreConfig) -> &mut Self
pub fn core(&mut self, core: CoreConfig) -> &mut Self
Sets the core configuration set which the configuration set this builder builds contains. The default is the default of the core configuration set.
Sourcepub fn channel_buffer(&mut self, v: usize) -> &mut Self
pub fn channel_buffer(&mut self, v: usize) -> &mut Self
Sets the buffer size of channels
which created in this node.
The default is 0x10000.
Sourcepub fn server(&mut self, addr: Option<StdSocketAddr>) -> &mut Self
pub fn server(&mut self, addr: Option<StdSocketAddr>) -> &mut Self
Sets the Option of the socket address of the server
which listens incomming connections.
If this is None, no server will be launched.
The default is None.
Sourcepub fn socks(&mut self, addr: Option<StdSocketAddr>) -> &mut Self
pub fn socks(&mut self, addr: Option<StdSocketAddr>) -> &mut Self
Sets the Option of the socket address of the SOCKS5 server
which is used by outgoing connections.
If this is None, connections are directly to Clearnet.
The default is None.
Sourcepub fn socks_auth(&mut self, auth: Option<SocksAuth>) -> &mut Self
pub fn socks_auth(&mut self, auth: Option<SocksAuth>) -> &mut Self
Sets the Option of the authentication method of the SOCKS5
which is used by outgoing connections.
The default is None.
Sourcepub fn connect_to_onion(&mut self, b: bool) -> &mut Self
pub fn connect_to_onion(&mut self, b: bool) -> &mut Self
Sets the flag whether this node connects to remote nodes
that have Onion addresses.
Only outgoing connections are affected.
The default is false.
Sourcepub fn connect_to_ip(&mut self, b: bool) -> &mut Self
pub fn connect_to_ip(&mut self, b: bool) -> &mut Self
Sets the flag whether this node connects to remote nodes
that have IP addresses.
Only outgoing connections are affected.
The default is false.
Sourcepub fn connect_to_myself(&mut self, b: bool) -> &mut Self
pub fn connect_to_myself(&mut self, b: bool) -> &mut Self
Sets the flag whether this node can connect to this node itself.
The default is false.
Sourcepub fn user_agent(&mut self, s: UserAgent) -> &mut Self
pub fn user_agent(&mut self, s: UserAgent) -> &mut Self
Sets the user agent which is sent to the nodes
this node connected to.
The default is "/PyBitmessage:0.6.3.2/".
Sourcepub fn stream_numbers(&mut self, list: StreamNumbers) -> &mut Self
pub fn stream_numbers(&mut self, list: StreamNumbers) -> &mut Self
Sets the set of stream numbers
that this node is interested in.
The default is [1].
Sourcepub fn seeds(&mut self, list: Vec<SocketAddrExt>) -> &mut Self
pub fn seeds(&mut self, list: Vec<SocketAddrExt>) -> &mut Self
Sets the list of socket addresses of the seed nodes.
The default is [].
Sourcepub fn bootstraps(&mut self, list: Vec<SocketAddrNode>) -> &mut Self
pub fn bootstraps(&mut self, list: Vec<SocketAddrNode>) -> &mut Self
Sets the list of socket addresses of the bootstrap domain names.
The default is [].
Sourcepub fn max_incoming_connected(&mut self, n: usize) -> &mut Self
pub fn max_incoming_connected(&mut self, n: usize) -> &mut Self
Sets the maximum number of incoming connections
this node accepts.
The default is 160.
Sourcepub fn max_incoming_established(&mut self, n: usize) -> &mut Self
pub fn max_incoming_established(&mut self, n: usize) -> &mut Self
Sets the maximum number of incoming established connections
this node accepts.
The default is 128.
Sourcepub fn max_outgoing_initiated(&mut self, n: usize) -> &mut Self
pub fn max_outgoing_initiated(&mut self, n: usize) -> &mut Self
Sets the maximum number of outgoing conections
this node initiates.
The default is 32.
Sourcepub fn max_outgoing_established(&mut self, n: usize) -> &mut Self
pub fn max_outgoing_established(&mut self, n: usize) -> &mut Self
Sets the maximum number of outgoing established connections
this node keeps.
The default is 8.
Sourcepub fn max_nodes(&mut self, n: usize) -> &mut Self
pub fn max_nodes(&mut self, n: usize) -> &mut Self
Sets the maximum number of node addresses
this node memorizes.
The default is 20000.
Sourcepub fn own_nodes(&mut self, list: Vec<SocketAddrExt>) -> &mut Self
pub fn own_nodes(&mut self, list: Vec<SocketAddrExt>) -> &mut Self
Sets the list of the socket addresses of the own node.
The default is [].
Trait Implementations§
impl Eq for Builder
impl StructuralPartialEq for Builder
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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