rostra-core 0.1.3

Signed event graph types for the Rostra protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::Serialize;

use super::EventContentUnsized;

impl Serialize for EventContentUnsized {
    fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
    where
        S: ::serde::Serializer,
    {
        if s.is_human_readable() {
            s.serialize_str(&self.to_string())
        } else {
            s.serialize_bytes(&self.0)
        }
    }
}