pub fn name(&self) -> Cow<'_, str> {
        let name: Cow<'_, str> = match &self.settings.text {
            Text::Center(text) => text.as_str().into(),
            Text::Split(left, right) => {
                let mut name = String::with_capacity(left.len() + right.len() + 1);
                name.push_str(left);
                if !left.is_empty() && !right.is_empty() {
                    name.push(' ');
                }
                name.push_str(right);
                name.into()
            }
            Text::Variable(var_name, _) => var_name.as_str().into(),
        };

        if name.trim().is_empty() {
            "Text".into()
        } else {
            name
        }
    }
/// Accesses the name of the component.
Accesses the name of the component.
Accesses the name of the component .
pub fn name(&self) -> Cow<'_, str> {
        let name: Cow<'_, str> = match &self.settings.text {
            Text::Center(text) => text.as_str().into(),
            Text::Split(left, right) => {
                let mut name = String::with_capacity(left.len() + right.len() + 1);
                name.push_str(left);
                if !left.is_empty() && !right.is_empty() {
                    name.push(' ');
                }
                name.push_str(right);
                name.into()
            }
            Text::Variable(var_name, _) => var_name.as_str().into(),
        };
        if name.trim().is_empty() {
            "Text".into()
        } else {
            name
        }
    }
pub fn name ( & self ) -> Cow < ' _ , str > { let name : Cow < ' _ , str > = match & self . settings . text { Text :: Center ( text ) => text . as_str ( ) . into ( ) , Text :: Split ( left , right ) => { let mut name = String :: with_capacity ( left . len ( ) + right . len ( ) + 1 ) ; name . push_str ( left ) ; if ! left . is_empty ( ) && ! right . is_empty ( ) { name . push ( ' ' ) ; } name . push_str ( right ) ; name . into ( ) } Text :: Variable ( var_name , _ ) => var_name . as_str ( ) . into ( ) , } ; if name . trim ( ) . is_empty ( ) { " " . into ( ) } else { name } }
Accesses the name of the component.
Accesses the name of the component .
&self
&self