MCPcopy Create free account
hub / github.com/InkSha/rust-tutorial / Serializer

Interface Serializer

src/todo/core.rs:66–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64// impl Serializer for TodoItem {}
65
66pub trait Serializer
67where
68 Self: Sized + Serialize + for<'a> Deserialize<'a>,
69{
70 fn serialize(&self) -> String {
71 serde_json::to_string(self).unwrap()
72 }
73
74 fn deserialize<S: Into<String>>(s: S) -> Self {
75 serde_json::from_str(&s.into()).unwrap()
76 }
77}
78
79impl Serializer for TodoItem {}
80

Callers 1

Implementers 1

core.rssrc/todo/core.rs

Calls

no outgoing calls

Tested by

no test coverage detected