rust_dynamic 0.49.0

Support for dynamically-typed values in run-time
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::fmt;
use crate::value::{Value};
use crate::types::*;

impl fmt::Display for Value {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.conv(STRING) {
            Ok(val) => write!(f, "{}", val.cast_string().unwrap()),
            Err(_) => write!(f, "Value({})={:?}", self.dt, self),
        }
    }
}