coda_api/ext/
parse_rich_value.rs1mod impl_try_from_rich_value_for_string;
2
3pub use impl_try_from_rich_value_for_string::*;
4
5mod impl_try_from_rich_value_for_bool;
6
7pub use impl_try_from_rich_value_for_bool::*;
8
9mod impl_try_from_rich_value_for_option_bool;
10
11pub use impl_try_from_rich_value_for_option_bool::*;
12
13#[cfg(feature = "time")]
14mod impl_try_from_rich_value_for_option_duration;
15
16#[cfg(feature = "time")]
17pub use impl_try_from_rich_value_for_option_duration::*;
18
19#[cfg(feature = "time")]
20mod impl_try_from_rich_value_for_option_offset_date_time;
21
22#[cfg(feature = "time")]
23pub use impl_try_from_rich_value_for_option_offset_date_time::*;
24
25mod impl_try_from_rich_value_for_rich_row_reference;
26
27pub use impl_try_from_rich_value_for_rich_row_reference::*;
28
29pub fn normalize_rich_string(value: &str) -> String {
30 if let Some(stripped) = value
31 .strip_prefix("```")
32 .and_then(|inner| inner.strip_suffix("```"))
33 {
34 stripped.to_string()
35 } else {
36 value.to_string()
37 }
38}
39
40pub fn normalize_owned_rich_string(value: String) -> String {
41 if value.len() >= 6 && value.starts_with("```") && value.ends_with("```") {
42 value[3..value.len() - 3].to_string()
43 } else {
44 value
45 }
46}