1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use crate::base_component::BaseComponent; #[derive(Clone, Debug)] pub struct TextComponent { pub base: BaseComponent, pub text: String, } impl<'a> TextComponent { pub fn new(text: String) -> Self { Self { base: BaseComponent::new(), text, } } pub fn to_string(&self) -> String { self.text.clone() } }