cbor_core/value/
string.rs1use super::*;
2
3impl From<&str> for Value {
4 fn from(value: &str) -> Self {
5 Self::TextString(value.into())
6 }
7}
8
9impl From<String> for Value {
10 fn from(value: String) -> Self {
11 Self::TextString(value)
12 }
13}
14
15impl From<&String> for Value {
16 fn from(value: &String) -> Self {
17 Self::TextString(value.clone())
18 }
19}
20
21impl From<Box<str>> for Value {
22 fn from(value: Box<str>) -> Self {
23 Self::TextString(value.into())
24 }
25}
26
27impl TryFrom<Value> for String {
28 type Error = Error;
29 fn try_from(value: Value) -> Result<Self> {
30 value.into_string()
31 }
32}