re_types/components/
text_ext.rs

1use super::Text;
2
3impl Text {
4    /// The text as a string slice.
5    #[inline]
6    pub fn as_str(&self) -> &str {
7        self.0.as_str()
8    }
9}
10
11impl From<Text> for String {
12    #[inline]
13    fn from(value: Text) -> Self {
14        value.as_str().to_owned()
15    }
16}
17
18impl AsRef<str> for Text {
19    #[inline]
20    fn as_ref(&self) -> &str {
21        self.as_str()
22    }
23}
24
25impl std::borrow::Borrow<str> for Text {
26    #[inline]
27    fn borrow(&self) -> &str {
28        self.as_str()
29    }
30}