pub struct NodeConfig {
pub name: String,
pub node_type: Option<NodeType>,
pub options: HashMap<String, ConfigValue>,
}Expand description
Configuration for a node.
Fields§
§name: StringHuman-readable name for the node.
node_type: Option<NodeType>Type of the node.
options: HashMap<String, ConfigValue>Custom configuration options.
Implementations§
Source§impl NodeConfig
impl NodeConfig
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new node configuration with the given name.
Sourcepub fn with_option(self, key: impl Into<String>, value: ConfigValue) -> Self
pub fn with_option(self, key: impl Into<String>, value: ConfigValue) -> Self
Add a configuration option.
Sourcepub fn get_option(&self, key: &str) -> Option<&ConfigValue>
pub fn get_option(&self, key: &str) -> Option<&ConfigValue>
Get a configuration option.
Sourcepub fn get_string(&self, key: &str) -> Option<&str>
pub fn get_string(&self, key: &str) -> Option<&str>
Get a string option.
Trait Implementations§
Source§impl Clone for NodeConfig
impl Clone for NodeConfig
Source§fn clone(&self) -> NodeConfig
fn clone(&self) -> NodeConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeConfig
impl Debug for NodeConfig
Source§impl Default for NodeConfig
impl Default for NodeConfig
Source§fn default() -> NodeConfig
fn default() -> NodeConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NodeConfig
impl RefUnwindSafe for NodeConfig
impl Send for NodeConfig
impl Sync for NodeConfig
impl Unpin for NodeConfig
impl UnsafeUnpin for NodeConfig
impl UnwindSafe for NodeConfig
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> 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