context_weaver/core/nodes/text.rs
1use crate::WorldInfoNode;
2
3#[derive(Debug, Clone)]
4pub struct TextNode {
5 pub(crate) content: String,
6}
7
8impl WorldInfoNode for TextNode {
9 fn content(&self) -> Result<String, crate::WorldInfoError> {
10 Ok(self.content.clone())
11 }
12
13 fn name(&self) -> String {
14 "text".to_string()
15 }
16
17 fn cloned(&self) -> Box<dyn WorldInfoNode> {
18 Box::new(self.to_owned())
19 }
20}