pub struct NodeOptions { /* private fields */ }Expand description
Options used to configure this node as a distributed node.
Implementations§
Source§impl NodeOptions
impl NodeOptions
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Constructs a new instance of NodeOptions with default values.
Sourcepub fn listen_address<T: Into<SocketAddr>>(self, address: T) -> Self
pub fn listen_address<T: Into<SocketAddr>>(self, address: T) -> Self
Sets the address this node will listen for incoming connections on.
Sourcepub fn broadcast_address<T: Into<SocketAddr>>(self, address: T) -> Self
pub fn broadcast_address<T: Into<SocketAddr>>(self, address: T) -> Self
Sets the address this node will advertise itself for remote connections.
Sourcepub fn handshake_timeout(self, duration: Duration) -> Self
pub fn handshake_timeout(self, duration: Duration) -> Self
Sets the time it takes to timeout a remote node handshake. (Default 5s)
Sourcepub fn heartbeat_interval(self, duration: Duration) -> Self
pub fn heartbeat_interval(self, duration: Duration) -> Self
Sets the time in which a ping packet is sent to a remote node if no other messages have been sent recently.
Sourcepub fn heartbeat_timeout(self, duration: Duration) -> Self
pub fn heartbeat_timeout(self, duration: Duration) -> Self
Sets the time it takes to consider a remote node down when not receiving any data.
Trait Implementations§
Source§impl Clone for NodeOptions
impl Clone for NodeOptions
Source§fn clone(&self) -> NodeOptions
fn clone(&self) -> NodeOptions
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 Default for NodeOptions
impl Default for NodeOptions
impl Copy for NodeOptions
Auto Trait Implementations§
impl Freeze for NodeOptions
impl RefUnwindSafe for NodeOptions
impl Send for NodeOptions
impl Sync for NodeOptions
impl Unpin for NodeOptions
impl UnwindSafe for NodeOptions
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