I'm trying to deserialize a String to Secp256k1Scalar, but I am getting the error error[E0277]: the trait bound "Secp256k1Scalar: Deserialize<'_>" is not satisfied, as shown below.
The code is:
let s2: Secp256k1Scalar = serde_json::from_str(&text).unwrap();
How can I deserialize a String to Secp256k1Scalar ?
error[E0277]: the trait bound `Secp256k1Scalar: Deserialize<'_>` is not satisfied
--> server/src/protocol/ecdsa.rs:134:32
|
134 | Some(s) => serde_json::from_str(&s).unwrap(),
| ^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `Secp256k1Scalar`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a RawStr
&'a UncasedStr
&'a [u8]
&'a rocket::form::name::Key
&'a rocket::form::name::Name
&'a serde_bytes::bytes::Bytes
&'a std::path::Path
&'a str
and 459 others
note: required by a bound in `serde_json::from_str`
--> /home/node/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.99/src/de.rs:2603:8
|
2603 | T: de::Deserialize<'a>,
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `from_str`
I'm trying to deserialize a
String
toSecp256k1Scalar
, but I am getting the errorerror[E0277]: the trait bound "Secp256k1Scalar: Deserialize<'_>" is not satisfied
, as shown below.The code is:
How can I deserialize a
String
toSecp256k1Scalar
?