We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0a800ca + 448af1b commit 7e224bfCopy full SHA for 7e224bf
primitives/src/ipfs.rs
@@ -11,6 +11,17 @@ pub use cid::{Cid, Error};
11
#[serde(try_from = "String", into = "String")]
12
pub struct IPFS(pub cid::Cid);
13
14
+impl slog::Value for IPFS {
15
+ fn serialize(
16
+ &self,
17
+ _record: &slog::Record<'_>,
18
+ key: slog::Key,
19
+ serializer: &mut dyn slog::Serializer,
20
+ ) -> slog::Result {
21
+ serializer.emit_str(key, &self.0.to_string())
22
+ }
23
+}
24
+
25
impl fmt::Debug for IPFS {
26
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27
write!(f, "IPFS({})", self.0.to_string())
@@ -31,6 +42,12 @@ impl FromStr for IPFS {
31
42
}
32
43
33
44
45
+impl AsRef<IPFS> for IPFS {
46
+ fn as_ref(&self) -> &IPFS {
47
+ &self
48
49
50
34
51
impl Into<String> for IPFS {
35
52
fn into(self) -> String {
36
53
self.0.into()
0 commit comments