pub struct AuthenticatedP2pConfig {
pub private_key: PrivateKey,
pub listen_addr: SocketAddr,
pub external_addr: SocketAddr,
pub bootstrappers: Vec<(PublicKey, SocketAddr)>,
pub mailbox_size: usize,
pub message_backlog: usize,
pub local: bool,
}Expand description
Configuration for the authenticated P2P network.
Fields§
§private_key: PrivateKeyOur private key for signing.
listen_addr: SocketAddrP2P listen address.
external_addr: SocketAddrOur external address (for NAT traversal).
bootstrappers: Vec<(PublicKey, SocketAddr)>Bootstrap nodes (public key, address).
mailbox_size: usizeMailbox size for message channels.
message_backlog: usizeMessage backlog size.
local: boolWhether running in local mode (relaxed timing).
Implementations§
Source§impl AuthenticatedP2pConfig
impl AuthenticatedP2pConfig
Sourcepub fn new(private_key: PrivateKey, listen_port: u16) -> Self
pub fn new(private_key: PrivateKey, listen_port: u16) -> Self
Creates a new configuration with sensible defaults.
Sourcepub fn with_external_addr(self, addr: SocketAddr) -> Self
pub fn with_external_addr(self, addr: SocketAddr) -> Self
Set the external address.
Sourcepub fn with_bootstrapper(self, key: PublicKey, addr: SocketAddr) -> Self
pub fn with_bootstrapper(self, key: PublicKey, addr: SocketAddr) -> Self
Add a bootstrapper.
Sourcepub fn with_local(self, local: bool) -> Self
pub fn with_local(self, local: bool) -> Self
Set local mode.
Trait Implementations§
Source§impl Clone for AuthenticatedP2pConfig
impl Clone for AuthenticatedP2pConfig
Source§fn clone(&self) -> AuthenticatedP2pConfig
fn clone(&self) -> AuthenticatedP2pConfig
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 AuthenticatedP2pConfig
impl RefUnwindSafe for AuthenticatedP2pConfig
impl Send for AuthenticatedP2pConfig
impl Sync for AuthenticatedP2pConfig
impl Unpin for AuthenticatedP2pConfig
impl UnwindSafe for AuthenticatedP2pConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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