[][src]Trait serde_traitobject::Display

pub trait Display: Display + Serialize + Deserialize { }

A convenience trait implemented on all (de)serializable implementors of std::fmt::Display.

It can be made into a trait object which is then (de)serializable.

Example

#[macro_use] extern crate serde_derive;
extern crate serde_json;
extern crate serde_traitobject as s;

fn message() -> s::Box<dyn s::Display> {
	s::Box::new(String::from("boxed displayable"))
}

let serialized = serde_json::to_string(&message()).unwrap();
let deserialized: s::Box<dyn s::Display> = serde_json::from_str(&serialized).unwrap();

println!("{}", deserialized);
// boxed displayable

Trait Implementations

impl<'a> AsRef<dyn Display + 'a> for dyn Display + 'a[src]

impl<'a> AsRef<dyn Display + 'a + Send> for dyn Display + Send + 'a[src]

impl Serialize for dyn Display[src]

impl Serialize for dyn Display + Send[src]

Implementors

impl<T: ?Sized> Display for T where
    T: Display + Serialize + Deserialize
[src]

Loading content...