pub struct NetBuilder { /* private fields */ }Expand description
Builder for constructing a Net node.
Implementations§
Source§impl NetBuilder
impl NetBuilder
Sourcepub fn identity(self, identity: Identity) -> Self
pub fn identity(self, identity: Identity) -> Self
Pin this node to a caller-owned Identity.
Stored on the builder and handed to whichever adapter consumes
keypairs (today: the mesh adapter when net is enabled). For
an event-bus-only node without a mesh adapter, the identity is
retained but unused — it becomes load-bearing once you wire in
a NetAdapterConfig.
Sourcepub fn buffer_capacity(self, capacity: usize) -> Self
pub fn buffer_capacity(self, capacity: usize) -> Self
Set the ring buffer capacity per shard (must be power of 2).
Sourcepub fn backpressure(self, bp: Backpressure) -> Self
pub fn backpressure(self, bp: Backpressure) -> Self
Set the backpressure strategy.
Sourcepub fn high_throughput(self) -> Self
pub fn high_throughput(self) -> Self
Use the high-throughput batch preset.
Sourcepub fn low_latency(self) -> Self
pub fn low_latency(self) -> Self
Use the low-latency batch preset.
Sourcepub fn batch(self, batch: BatchConfig) -> Self
pub fn batch(self, batch: BatchConfig) -> Self
Set a custom batch configuration.
Sourcepub fn scaling(self, policy: ScalingPolicy) -> Self
pub fn scaling(self, policy: ScalingPolicy) -> Self
Enable dynamic scaling.
Sourcepub fn adapter_timeout(self, timeout: Duration) -> Self
pub fn adapter_timeout(self, timeout: Duration) -> Self
Set the adapter timeout.
Sourcepub fn mesh(self, config: NetAdapterConfig) -> Self
pub fn mesh(self, config: NetAdapterConfig) -> Self
Use Net encrypted UDP mesh transport.
Auto Trait Implementations§
impl !RefUnwindSafe for NetBuilder
impl !UnwindSafe for NetBuilder
impl Freeze for NetBuilder
impl Send for NetBuilder
impl Sync for NetBuilder
impl Unpin for NetBuilder
impl UnsafeUnpin for NetBuilder
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