pub struct RemapRule {
pub node_name: Option<String>,
pub from: String,
pub to: String,
}Expand description
Represents a name remapping rule
Remapping rules can be either global (applying to all nodes) or node-specific.
§Examples
- Global:
foo:=barremapsfootobarfor all nodes - Node-specific:
my_node:foo:=barremapsfootobaronly formy_node
Fields§
§node_name: Option<String>Optional node name to target (None means applies to all nodes)
from: StringThe original name to remap from
to: StringThe new name to remap to
Implementations§
Source§impl RemapRule
impl RemapRule
Sourcepub fn new_global(from: String, to: String) -> Self
pub fn new_global(from: String, to: String) -> Self
Create a new global remapping rule
Sourcepub fn new_node_specific(node_name: String, from: String, to: String) -> Self
pub fn new_node_specific(node_name: String, from: String, to: String) -> Self
Create a new node-specific remapping rule
Sourcepub fn applies_to_node(&self, node_name: &str) -> bool
pub fn applies_to_node(&self, node_name: &str) -> bool
Check if this rule applies to a specific node
Trait Implementations§
impl Eq for RemapRule
impl StructuralPartialEq for RemapRule
Auto Trait Implementations§
impl Freeze for RemapRule
impl RefUnwindSafe for RemapRule
impl Send for RemapRule
impl Sync for RemapRule
impl Unpin for RemapRule
impl UnsafeUnpin for RemapRule
impl UnwindSafe for RemapRule
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