resource_path/third_party/ser.rs
1use serde::{ser::SerializeStruct, Serialize, Serializer};
2
3use crate::ResourcePath;
4
5impl Serialize for ResourcePath {
6 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7 where
8 S: Serializer,
9 {
10 let mut s = serializer.serialize_struct("ResourcePath", 2)?;
11 s.serialize_field("network", &self.remote)?;
12 s.serialize_field("local", &self.local)?;
13 s.end()
14 }
15}