Struct erdos::Configuration
source · [−]pub struct Configuration {
pub index: NodeId,
pub num_threads: usize,
pub data_addresses: Vec<SocketAddr>,
pub control_addresses: Vec<SocketAddr>,
pub graph_filename: Option<String>,
pub logging_level: Option<Level>,
}
Expand description
Stores the configuration parameters of a node
.
Fields
index: NodeId
The index of the node.
num_threads: usize
The number of OS threads the node will use.
data_addresses: Vec<SocketAddr>
Mapping between node indices and data socket addresses.
control_addresses: Vec<SocketAddr>
Mapping between node indices and control socket addresses.
graph_filename: Option<String>
DOT file to export dataflow graph.
logging_level: Option<Level>
The logging level of the logger initialized by ERDOS.
If None
, ERDOS will not initialize a logger.
Defaults to Level::DEBUG
when compiling in debug mode,
Level::INFO
when compiling in release mode.
While tracing
provides extensions for connecting additional
subscribers, note that these may impact performance.
Implementations
sourceimpl Configuration
impl Configuration
sourcepub fn new(
node_index: NodeId,
data_addresses: Vec<SocketAddr>,
control_addresses: Vec<SocketAddr>,
num_threads: usize
) -> Self
pub fn new(
node_index: NodeId,
data_addresses: Vec<SocketAddr>,
control_addresses: Vec<SocketAddr>,
num_threads: usize
) -> Self
Creates a new node configuration.
sourcepub fn from_args(args: &ArgMatches<'_>) -> Self
pub fn from_args(args: &ArgMatches<'_>) -> Self
Creates a node configuration from command line arguments.
sourcepub fn export_dataflow_graph(self, filename: &str) -> Self
pub fn export_dataflow_graph(self, filename: &str) -> Self
Upon executing, exports the dataflow graph as a DOT file.
sourcepub fn with_logging_level(self, level: Level) -> Self
pub fn with_logging_level(self, level: Level) -> Self
Sets the logging level.
sourcepub fn disable_logger(self) -> Self
pub fn disable_logger(self) -> Self
ERDOS will not initialize a logger if this method is called.
Trait Implementations
sourceimpl Clone for Configuration
impl Clone for Configuration
sourcefn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more