bel/common/types/string.rs
1use std::{any::Any, string::String as StdString};
2
3use crate::common::{types::Type, value::Val};
4
5pub struct String(StdString);
6
7impl Val for String {
8 fn get_type(&self) -> Type<'_> {
9 super::STRING_TYPE
10 }
11
12 fn into_inner(self) -> Box<dyn Any> {
13 Box::new(self.0)
14 }
15}
16
17impl From<StdString> for String {
18 fn from(v: StdString) -> Self {
19 Self(v)
20 }
21}
22
23impl From<String> for StdString {
24 fn from(v: String) -> Self {
25 v.0
26 }
27}