diff options
Diffstat (limited to 'azalea-brigadier/src/context/parsed_command_node.rs')
| -rw-r--r-- | azalea-brigadier/src/context/parsed_command_node.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/azalea-brigadier/src/context/parsed_command_node.rs b/azalea-brigadier/src/context/parsed_command_node.rs index e69de29b..98e99959 100644 --- a/azalea-brigadier/src/context/parsed_command_node.rs +++ b/azalea-brigadier/src/context/parsed_command_node.rs @@ -0,0 +1,22 @@ +use super::string_range::StringRange; +use crate::tree::command_node::CommandNode; + +#[derive(Hash, PartialEq, Eq, Debug, Clone)] +pub struct ParsedCommandNode<S> { + node: dyn CommandNode<S>, + range: StringRange, +} + +impl<S> ParsedCommandNode<S> { + fn new(node: dyn CommandNode<S>, range: StringRange) -> Self { + Self { node, range } + } + + fn node(&self) -> &dyn CommandNode<S> { + &self.node + } + + fn range(&self) -> &StringRange { + &self.range + } +} |
