Struct EoNBuilder

Source
pub struct EoNBuilder { /* private fields */ }
Expand description

A builder for creating and configuring Edge of Network (EoN) instances.

Implementations§

Source§

impl EoNBuilder

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.