utility_cli_rs/types/
signature.rs1#[derive(Debug, Clone)]
2pub struct Signature(pub unc_crypto::Signature);
3
4impl std::fmt::Display for Signature {
5 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6 self.0.fmt(f)
7 }
8}
9
10impl std::str::FromStr for Signature {
11 type Err = unc_crypto::ParseSignatureError;
12
13 fn from_str(s: &str) -> Result<Self, Self::Err> {
14 let signature = unc_crypto::Signature::from_str(s)?;
15 Ok(Self(signature))
16 }
17}
18
19impl From<Signature> for unc_crypto::Signature {
20 fn from(item: Signature) -> Self {
21 item.0
22 }
23}