pub struct NodesConfig(pub HashMap<String, NodeEntry>);Expand description
Map of node identifiers (e.g. @mecha10/listener, my-custom) to their config - at minimum
a pinned version, optionally an expanded NodeEntry::Detailed form declaring enabled/
capabilities too.
Tuple Fields§
§0: HashMap<String, NodeEntry>Implementations§
Source§impl NodesConfig
impl NodesConfig
Sourcepub fn new() -> NodesConfig
pub fn new() -> NodesConfig
Create a new empty nodes config
Sourcepub fn get_node_specs(&self) -> Vec<NodeSpec>
pub fn get_node_specs(&self) -> Vec<NodeSpec>
Get all node specs from the configuration
Sourcepub fn get_node_names(&self) -> Vec<String>
pub fn get_node_names(&self) -> Vec<String>
Get all node names (for lifecycle mode validation)
Sourcepub fn find_by_name(&self, name: &str) -> Option<NodeSpec>
pub fn find_by_name(&self, name: &str) -> Option<NodeSpec>
Find a node by name
Sourcepub fn get_version(&self, identifier: &str) -> Option<&str>
pub fn get_version(&self, identifier: &str) -> Option<&str>
Get the version for a node identifier
Sourcepub fn add_node(&mut self, identifier: &str, version: &str)
pub fn add_node(&mut self, identifier: &str, version: &str)
Add a node to the configuration with a version
Sourcepub fn remove_node(&mut self, name: &str)
pub fn remove_node(&mut self, name: &str)
Remove a node from the configuration
Sourcepub fn identifiers(&self) -> Vec<&str>
pub fn identifiers(&self) -> Vec<&str>
Get all identifiers
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over (identifier, version) pairs
Sourcepub fn aggregated_capabilities(&self) -> HashSet<Capability>
pub fn aggregated_capabilities(&self) -> HashSet<Capability>
The union of every enabled node’s declared Capability set. A node without an
expanded NodeEntry::Detailed entry (the common plain-version-string case)
contributes nothing - capabilities are explicitly declared per node, never inferred
from node type.
Trait Implementations§
Source§impl Clone for NodesConfig
impl Clone for NodesConfig
Source§fn clone(&self) -> NodesConfig
fn clone(&self) -> NodesConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodesConfig
impl Debug for NodesConfig
Source§impl Default for NodesConfig
impl Default for NodesConfig
Source§fn default() -> NodesConfig
fn default() -> NodesConfig
Source§impl<'de> Deserialize<'de> for NodesConfig
impl<'de> Deserialize<'de> for NodesConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodesConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodesConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for NodesConfig
impl JsonSchema for NodesConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for NodesConfig
impl Serialize for NodesConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for NodesConfig
impl RefUnwindSafe for NodesConfig
impl Send for NodesConfig
impl Sync for NodesConfig
impl Unpin for NodesConfig
impl UnsafeUnpin for NodesConfig
impl UnwindSafe for NodesConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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