pub struct EoNBuilder { /* private fields */ }Expand description
A builder for creating and configuring Edge of Network (EoN) instances.
Implementations§
Source§impl EoNBuilder
impl EoNBuilder
Sourcepub fn new<E: EventLoop + Send + 'static, C: Client + Send + Sync + 'static>(
eventloop: E,
client: C,
) -> Self
pub fn new<E: EventLoop + Send + 'static, C: Client + Send + Sync + 'static>( eventloop: E, client: C, ) -> Self
Creates a new builder with the specified event loop and client.
Initializes a builder with default values and a no-op metric manager.
Sourcepub fn with_group_id<S: Into<String>>(self, group_id: S) -> Self
pub fn with_group_id<S: Into<String>>(self, group_id: S) -> Self
Sets the group ID for the EoN instance.
The group ID identifies the group to which this node belongs.
Sourcepub fn with_node_id<S: Into<String>>(self, node_id: S) -> Self
pub fn with_node_id<S: Into<String>>(self, node_id: S) -> Self
Sets the node ID for the EoN instance.
The node ID uniquely identifies this node within its group.
Sourcepub fn with_metric_manager<M: NodeMetricManager + Send + Sync + 'static>(
self,
metric_manager: M,
) -> Self
pub fn with_metric_manager<M: NodeMetricManager + Send + Sync + 'static>( self, metric_manager: M, ) -> Self
Sets a custom metric manager for the EoN instance.
Replaces the default no-op metric manager with the provided implementation.
Sourcepub fn build(self) -> Result<(EoN, NodeHandle), String>
pub fn build(self) -> Result<(EoN, NodeHandle), String>
Builds the EoN instance with the configured settings.
Creates and returns a new EoN instance and its associated NodeHandle. This method will return an error if required configuration is missing or if there are other issues with the configuration.