(deserializer: D)
| 125 | |
| 126 | impl<'de> Deserialize<'de> for Signature { |
| 127 | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> |
| 128 | where |
| 129 | D: serde::Deserializer<'de>, |
| 130 | { |
| 131 | if deserializer.is_human_readable() { |
| 132 | let s = String::deserialize(deserializer)?; |
| 133 | Signature::from_base32(&s).map_err(serde::de::Error::custom) |
| 134 | } else { |
| 135 | let bytes = <Vec<u8>>::deserialize(deserializer)?; |
| 136 | Signature::from_slice(&bytes).map_err(serde::de::Error::custom) |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /// A signer that can create signatures using a secret key. |
nothing calls this directly
no test coverage detected